Configuration parameter

unix_socket_directories — PostgreSQL Configuration Parameter

Category Connections Default '/tmp' Unit boolean / enum / numeric Change scope Restart required

Directories for Unix-domain socket files.

At a glance

Property Value
Parameter unix_socket_directories
Category Connections
Default '/tmp'
Value type boolean / enum / numeric
Change scope Restart required

What it does

Lists the directories in which the server creates Unix-domain sockets. Many packaged builds default to /var/run/postgresql.

How to apply a change

Requires a full server restart (postmaster context). Set it in postgresql.conf and restart PostgreSQL.

Inspect the current value and source with SHOW unix_socket_directories; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'unix_socket_directories';.

Tuning guidance

Match this to where your clients and libpq look (PGHOST). Mismatches cause “could not connect to server: No such file or directory” on local connections.

Reference

PostgreSQL documentation — Connections configuration.

Was this helpful?

← All configuration parameters