PostgreSQL: remaining connection slots are reserved
FATAL: remaining connection slots are reserved for non-replication superuser connectionsThe connections available to normal roles are exhausted, and the only slots left are the ones Postgres reserves for superusers. Reduce your connection count with pooling, or raise max_connections.
What this error means
Postgres reserves a few connection slots (superuser_reserved_connections) so an administrator can always get in, even when the server is busy. When non-superuser connections fill every remaining slot, new ones get this error while the reserved slots stay untouched.
It is effectively the same root problem as 'too many clients already': you are at the connection ceiling, usually from a leak or a missing pool.
How to fix it
You are at the connection ceiling
Pool connections and lower the app pool size so you stay below the non-reserved limit.
You genuinely need more slots
Raise max_connections and restart Postgres.
ALTER SYSTEM SET max_connections = 200;
-- then restart PostgresIdle sessions are holding slots
Terminate idle connections to recover them immediately.
SELECT pg_terminate_backend(pid)
FROM pg_stat_activity
WHERE state = 'idle';How to avoid it next time
- Always run application traffic through a pooler, so a small number of real connections serve many clients.
- Monitor connection counts and alert before you reach the ceiling.
Postgres 16 reworded this to "reserved for roles with the SUPERUSER attribute" and added a separate reserved_connections setting for reserving slots to non-superusers.
Frequently asked questions
Why are some slots reserved?
So a superuser can always connect to investigate, even when the server is saturated. superuser_reserved_connections controls how many.
Is this the same as 'too many clients already'?
Nearly. Both mean you hit the connection ceiling. This variant appears when only the superuser-reserved slots remain.
Stop struggling with SQL
Use FluentDB, the AI database client for macOS.
Related errors
Part of the PostgreSQL error reference. Last reviewed 2026-07-31.