docs(postgres): init; specify unix-domain socket length limitation (#147)

Co-authored-by: Sridhar Ratnakumar <3998+srid@users.noreply.github.com>
This commit is contained in:
Shivaraj B H 2024-03-13 00:56:57 +05:30 committed by GitHub
parent 18f9decf13
commit 0db2423f20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 36 additions and 1 deletions

35
doc/postgresql.md Normal file
View File

@ -0,0 +1,35 @@
# PostgreSQL
[PostgreSQL](https://www.postgresql.org/) is a powerful, open source object-relational database system with over 35 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.
## Getting Started
```nix
# In `perSystem.process-compose.<name>`
{
services.postgres."pg1".enable = true;
}
```
## Examples
- Run postgres server initialised with a sample database and graphically interact with it using [pgweb](https://github.com/sosedoff/pgweb): <https://github.com/juspay/services-flake/tree/main/example/simple>
## Gotchas
{#socket-path}
### Unix-domain socket path is too long
We already talk about this in the [data directory guide](guide/datadir.md#socket-path). In case of postgres, you can set `socketDir` while keeping the `dataDir` unchanged.
>[!note]
> The `socketDir` must be set to a shorter path (less than 100 chars) as a workaround.
```nix
{
services.postgres."pg1" = {
enable = true;
socketDir = "/tmp/pg1";
};
}
```

View File

@ -12,7 +12,7 @@ short-title: Services
- Elasticsearch
- MySQL
- Nginx
- PostgreSQL
- [[postgresql]]#
- Redis
- Redis Cluster
- Zookeeper