# unix_socket_permissions

> unix_socket_permissions is the PostgreSQL setting that defines the access permissions of the Unix-domain socket.
---

> [!NOTE]
> **Fact — official short description:** “Sets the access permissions of the Unix-domain socket.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `integer` | Upstream pg_settings type |
| Context | `postmaster` | Requires a server restart |
| Unit | — | Raw unit |
| Range | `0` – `511` | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Connections and Authentication / Connection Settings | Upstream classification |
| Latest boot value | `511` | 511 |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG9.0 (research boundary) |
| Present in | PG9.0–19 Beta 3 |
| Removed in | No |
| Introduction commit | Not asserted: predates the PG9.0 research boundary |
| Commit date | — |
| Discussion | — |

## Default history {#default-history}

| Versions | Raw `boot_val` | Unit | Human value |
| --- | --- | --- | --- |
| PG9.0–19 Beta 3 | `511` | — | 511 |
{.full-width caption="Measured PG9.0–19 Beta 3 boot defaults"}

## How it works {#mechanism}

unix_socket_permissions sets the chmod-style mode of filesystem Unix-domain sockets. Use a leading zero for octal notation. For a socket, only the write bit controls the ability to connect; read and execute bits do not provide meaningful additional socket access.

It is a POSTMASTER-context setting, so the mode changes only when sockets are recreated at server restart. Directory traversal permissions and unix_socket_group can form another local boundary, while pg_hba.conf local records still authenticate database users independently.

Abstract-namespace sockets have no filesystem permissions, so this setting is ignored for @-prefixed socket entries. Some operating systems also ignore socket modes entirely; the page must not present the mode as a portable replacement for directory permissions or pg_hba.conf.

## Tuning advice {#tuning-advice}

> [!TIP]
> **Advice.** These are workload-specific starting points and must be validated with measurements.

| Workload | Guidance |
| --- | --- |
| OLTP | Use 0770 or 0700 only when local operating-system membership is an intentional first boundary, and verify that directory permissions and pg_hba.conf still enforce the desired policy. The portable default 0777 can be acceptable when pg_hba.conf is authoritative. |
| OLAP | Apply the same local policy to analytical tools. Do not weaken the mode to solve a missing group or directory deployment; repair the operating-system identity path instead. |
| Small nodes | Choose the simplest mode supported by the platform and test it after restart. For abstract sockets or systems that ignore socket modes, enforce access through the directory choice where applicable and pg_hba.conf. |
{.full-width}

## Pigsty {#pigsty}

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

| Template | Effective value | Versus upstream boot | Source expression |
| --- | --- | --- | --- |
| OLTP | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
{.full-width}

> [!CAUTION]
> **Advice — pending human review.** Fact from the current Pigsty template projection: OLTP: PG9.0–19 Beta 3 unmodified; OLAP: PG9.0–19 Beta 3 unmodified; CRIT: PG9.0–19 Beta 3 unmodified; TINY: PG9.0–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

## Common pitfalls {#common-pitfalls}

- Writing decimal 770 instead of octal 0770 and creating an unintended numeric mode.
- Expecting read or execute bits to control socket connection access; only the write bit matters.
- Relying on the mode for abstract-namespace sockets or operating systems that ignore socket permissions.
- Treating a restrictive socket mode as a substitute for pg_hba.conf authentication, role privileges, or directory traversal controls.

## Related parameters {#related-parameters}

[`listen_addresses`](/parameters/listen-addresses/) · [`port`](/parameters/port/) · [`max_connections`](/parameters/max-connections/) · [`reserved_connections`](/parameters/reserved-connections/) · [`superuser_reserved_connections`](/parameters/superuser-reserved-connections/) · [`unix_socket_directories`](/parameters/unix-socket-directories/)

## References {#references}

- [PostgreSQL 19 Beta 3 — unix_socket_permissions](https://www.postgresql.org/docs/19/runtime-config-connection.html#GUC-UNIX-SOCKET-PERMISSIONS)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
