What is this issue?
PostgreSQL reserves connections for superusers via superuser_reserved_connections.
These connections remain available even when regular connections are exhausted.
If set too low (< 3):
- Administrators may not be able to connect during crises
- Diagnosing connection exhaustion becomes impossible
- Manual intervention requires console access
The default is 3, which is usually sufficient.
Why it matters
Admin Lockout
Can't connect to diagnose when connections are full
Delayed Recovery
Must use console access instead of SQL
Monitoring Gaps
Monitoring tools may lose access
Crisis Management
Harder to terminate runaway sessions
How PG Pilot detects it
```sql SELECT name, setting FROM pg_settings WHERE name = 'superuser_reserved_connections'; ```
How to fix it
Increase reserved connections
Reserve 3-5 connections for superusers:
ALTER SYSTEM SET superuser_reserved_connections = 5;Requires restart.
Plan connection budget
Ensure max_connections accounts for reserved:
Available for apps = max_connections - superuser_reserved_connectionsPrevention
- Keep at least 3 reserved connections
- Account for reserved connections when sizing pools
- Test admin access during load testing