Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs([tokio-]postgres/config): fix examples for unix socket paths #1225

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

transcaffeine
Copy link

The commonly used location for sockets is /run/{service}, with /var/lib/{service} containing the actual data from the service.

@sfackler
Copy link
Owner

sfackler commented Mar 2, 2025

That may be true, but the commonly used location (in e.g. Ubuntu 24.04) for the Postgres socket is /var/lib/{service}.

@leona-ya
Copy link

leona-ya commented Mar 2, 2025

On a new Ubuntu 24.04 (with the standard repos) on a clean install I get the postgresql socket in /run/postgresql (equivalent to /var/run/postgresql):

root@testubuntu01:~# ls /var/run/postgresql/ -al
total 8
drwxrwsr-x  2 postgres postgres  100 Mar  2 20:21 .
drwxr-xr-x 31 root     root     1080 Mar  2 20:21 ..
srwxrwxrwx  1 postgres postgres    0 Mar  2 20:21 .s.PGSQL.5432
-rw-------  1 postgres postgres   70 Mar  2 20:21 .s.PGSQL.5432.lock
-rw-r--r--  1 postgres postgres    6 Mar  2 20:21 16-main.pid
root@testubuntu01:~# uname -a
Linux testubuntu01 6.8.0-52-generic #53-Ubuntu SMP PREEMPT_DYNAMIC Sat Jan 11 00:06:25 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
root@testubuntu01:~# cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.1 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian

@sfackler
Copy link
Owner

sfackler commented Mar 2, 2025

Sorry, yeah I misread /var/run as /var/lib. I'd prefer this use /var/run/postgresql instead of just /run to match with how psql is built:

root@80cc00b8042c:/# psql
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
        Is the server running locally and accepting connections on that socket?
```

The commonly used location for sockets is `/run/{service}`, with
`/var/lib/{service}` containing the actual data from the service.
@transcaffeine
Copy link
Author

@sfackler i changed the paths to be all /var/run/postgresql :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants