# reserved_connections

> reserved_connections is the PostgreSQL setting that defines the number of connection slots reserved for roles with privileges of pg_use_reserved_connections.
---

> [!NOTE]
> **Fact — official short description:** “Sets the number of connection slots reserved for roles with privileges of pg_use_reserved_connections.”

## Identity {#identity}

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

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG16 |
| Present in | PG16–19 Beta 3 |
| Removed in | No |
| Introduction commit | [`6e2775e4d4e4`](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=6e2775e4d4e47775f0d933e4a93c148024a3bc63) — Add new GUC reserved_connections. |
| Commit date | 2023-01-20 |
| Discussion | [thread 1](https://postgr.es/m/20230119194601.GA4105788@nathanxps13) |

## Default history {#default-history}

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

## How it works {#mechanism}

reserved_connections sets the number of connection slots reserved for roles with privileges of pg_use_reserved_connections. These slots become available only to roles granted pg_use_reserved_connections and sit above ordinary capacity but below superuser-only reserves.

reserved_connections is a POSTMASTER-context setting: PostgreSQL reads it during server startup, and a configuration reload or session SET cannot activate a new value.

reserved_connections and superuser_reserved_connections carve privileged tiers from max_connections; poolers, monitoring, replication, maintenance, and failover must all fit the same total backend budget.

## Tuning advice {#tuning-advice}

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

| Workload | Guidance |
| --- | --- |
| OLTP | Size reserved_connections inside max_connections from the number of independent emergency actors, pooler behavior, and failover operations. Test that ordinary saturation still leaves usable administrative access. |
| OLAP | Reserve enough slots for control, monitoring, and cancellation around heavy analytical sessions, but do not let reserves consume an excessive share of a deliberately small backend pool. |
| Small nodes | Keep reserved_connections modest relative to max_connections while preserving at least one tested emergency path; reserved slots are capacity unavailable to ordinary clients at saturation. |
{.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: PG16–19 Beta 3 unmodified; OLAP: PG16–19 Beta 3 unmodified; CRIT: PG16–19 Beta 3 unmodified; TINY: PG16–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

## Common pitfalls {#common-pitfalls}

- Expecting a reload or SET to activate reserved_connections, although it requires a controlled server restart.
- Counting reserved slots outside max_connections even though every tier consumes the same total ceiling.
- Reserving too little for incident response or so much that ordinary application capacity collapses at saturation.
- Sizing ordinary, reserved, and superuser-reserved slots without ensuring their sum fits max_connections.

## Related parameters {#related-parameters}

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

## References {#references}

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