SQLSTATE 53300Severity highLab verified

Incident brief

Too many connections

A non-superuser connection attempt arrived after every non-reserved connection slot was already in use. PostgreSQL rejected it so the reserved slots stay available for superuser roles.

Reproduced on PostgreSQL 16.14Verified 2026-07-16 (Docker lab, PostgreSQL 16.14)Reviewed by Verified against PostgreSQL 16.14 in an isolated lab environment

In 10 seconds

What
Too many connections
What triggers it
With max_connections = 100 and superuser_reserved_connections = 3 (both defaults), open 97 connections with a non-superuser role and hold them open.
The fix
Raise max_connections (requires a restart) if the application genuinely needs more concurrent connections.
Proof
Reproduced on PostgreSQL 16.14 → With every non-reserved connection slot (97 of 100, since 3 are reserved for superusers) held open by a non-superuser role, one more connection attempt with that role was rejected with SQLSTATE 53300.

The fix

What to do right now

The immediate, application-level response to this error.

  • Raise max_connections (requires a restart) if the application genuinely needs more concurrent connections.
  • Put a connection pooler (e.g. PgBouncer) in front of PostgreSQL so application connections are reused instead of each request opening a new one.
  • Don't 'fix' this by lowering superuser_reserved_connections to 0 — see the premium counterexample for exactly what that gives up.
Fix — SQL
-- Example direction: front the application with a pooler instead of connecting directly.
-- max_connections = 100                  -- unchanged
-- superuser_reserved_connections = 3     -- unchanged, keeps an admin path open
SELECT 1 AS use_a_connection_pooler_in_production;

Related & next steps

Follow the thread

Everything this error touches — jump straight to the sibling error, term, runbook, or parameter.

Verification

PG 16.14
Last verified
2026-07-16 (Docker lab, PostgreSQL 16.14)
Reviewed by
Verified against PostgreSQL 16.14 in an isolated lab environment
Audit status
reviewed