DB Internals AtlasPostgreSQL 18.6 Home About

Parameter · Connections and Authentication / Connection Settings

reserved_connections

Sets the number of connection slots reserved for roles with privileges of pg_use_reserved_connections.

  • Default: 0
  • Type: integer
  • Range: 0 … 262143
  • Applies: Restart required

In plain words

Extra connection slots kept for trusted roles that are not superusers, such as a monitoring agent. Grant them pg_use_reserved_connections and they can still connect when the application has exhausted its share.

The default 0 turns this reserve off.

For DBAs and operators

Added in PostgreSQL 16. When the number of free slots is greater than superuser_reserved_connections but ≤ superuser_reserved_connections + reserved_connections, only superusers and members of pg_use_reserved_connections are admitted. Others get FATAL: remaining connection slots are reserved for roles with privileges of the "pg_use_reserved_connections" role. Once only the superuser reserve is left, even these roles get the SUPERUSER message.

GRANT pg_use_reserved_connections TO monitoring;
-- postgresql.conf (restart required)
reserved_connections = 2

The value must be less than max_connections − superuser_reserved_connections, and it reduces the number of slots ordinary roles can use. Reserve slots for operational roles that genuinely need to connect during a connection storm, while leaving the superuser reserve available for emergency administration. Access to these slots is determined by membership in pg_use_reserved_connections; the right count depends on your monitoring, automation and incident-response connection needs.

How to change it

Change in postgresql.conf or ALTER SYSTEM, then restart the server.

See it in context

Roles and privileges Client backend Process model Postmaster

Related parameters

superuser_reserved_connections max_connections

All Connections and Authentication parameters