// postgresql · connections

superuser_reserved_connections

Connection slots kept back for superusers.

Standard
3
Range
0 to 262143, less than max_connections
Restart needed
Ja
Default checked on
PostgreSQL 18

Was es bewirkt

When max_connections minus these slots is reached, only superusers can connect, so an administrator can still get in to kill runaway sessions.

Standardwert

3. 3 (PostgreSQL 18).

Check the current value

SHOW superuser_reserved_connections;

SELECT setting, unit, boot_val, context, source, pending_restart
FROM pg_settings
WHERE name = 'superuser_reserved_connections';

Change it

ALTER SYSTEM SET superuser_reserved_connections = 5;
-- applies only after a server restart

Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf.

When to change it

Rarely. Raise it if monitoring and admin tools connecting as superuser regularly use up the 3 slots.

What can go wrong

Setting it to 0 means a connection storm can lock administrators out.

Questions about superuser_reserved_connections

What is the default value of superuser_reserved_connections in PostgreSQL?

3. 3 (PostgreSQL 18).

Does changing superuser_reserved_connections require a restart?

Yes. Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf.

When should I change superuser_reserved_connections?

Rarely. Raise it if monitoring and admin tools connecting as superuser regularly use up the 3 slots.

Back to all PostgreSQL settings, or check the PostgreSQL manual for every option.

// one client for every engine

Check superuser_reserved_connections on your own server

SQLly runs the query above against PostgreSQL and the other engines in this reference, from one desktop app on macOS, Windows and Linux.