Parameter · Connections and Authentication / Connection Settings
unix_socket_group
Sets the owning group of the Unix-domain socket. The owning user of the socket is always the user that starts the server. An empty string means use the user's default group.
- Default:
'' (empty) - Type: string
- Applies: Restart required
In plain words
The operating-system group that owns the local socket file. Together with unix_socket_permissions = 0770 it limits local connections to the server user and members of that group.
Empty (the default) means the primary group of the user running PostgreSQL.
For DBAs and operators
The owning user of the socket is always the OS user that runs the server; this setting only changes the group (chown :group). It is an operating-system level check that happens before PostgreSQL authentication: a user who cannot open the socket gets psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: Permission denied and nothing appears in the PostgreSQL log.
The group must exist and the server user must be a member of it, otherwise startup fails. Not supported on Windows, and meaningless for abstract-namespace sockets (@name). The directory itself also needs search (x) permission for the connecting users, which is often the real cause when this seems not to work.
In most deployments this is left empty and access control is done with pg_hba.conf local lines (peer, scram-sha-256).
How to change it
Change in postgresql.conf or ALTER SYSTEM, then restart the server.