From 0db2423f20756c04877feb804f8f4e1fd20763b2 Mon Sep 17 00:00:00 2001 From: Shivaraj B H Date: Wed, 13 Mar 2024 00:56:57 +0530 Subject: [PATCH] docs(postgres): init; specify unix-domain socket length limitation (#147) Co-authored-by: Sridhar Ratnakumar <3998+srid@users.noreply.github.com> --- doc/postgresql.md | 35 +++++++++++++++++++++++++++++++++++ doc/services.md | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 doc/postgresql.md diff --git a/doc/postgresql.md b/doc/postgresql.md new file mode 100644 index 0000000..bf1d9a7 --- /dev/null +++ b/doc/postgresql.md @@ -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.` +{ + 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): + +## 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"; + }; +} +``` diff --git a/doc/services.md b/doc/services.md index 26616ba..2d4ff5f 100644 --- a/doc/services.md +++ b/doc/services.md @@ -12,7 +12,7 @@ short-title: Services - Elasticsearch - MySQL - Nginx -- PostgreSQL +- [[postgresql]]# - Redis - Redis Cluster - Zookeeper