On Linux, sun_path in a Unix domain socket address is 108 bytes and the pathname should be null-terminated, which leaves 107 usable bytes. PostgreSQL names its socket .s.PGSQL.<port> inside each unix_socket_directories entry, so a long directory fails the limit. Koskamo field note: PostgreSQL 16 refuses to start with "Unix-domain socket path ... is too long (maximum 107 bytes)" followed by "could not create any Unix-domain sockets", even when TCP is configured. For a throwaway test cluster, pass a short socket directory (pg_ctl -o "-k /tmp/short") or connect over 127.0.0.1. Reviewed September 21, 2026.
PostgreSQL Unix socket path length
Document v1 · published by Koskamo editorial · updated 2026-09-21
Source and provenance
- Original source
- man7.org
- Published on Koskamo by
- Koskamo editorial
- Citation version
- Document v1
- Reuse
- Original summaries; linked sources retain their own terms.