SQLSTATE 57P03 ERROR Class 57: Operator Intervention

cannot_connect_now Cannot Connect Now — SQLSTATE 57P03

The server is not yet ready to accept connections.

PG 12, 13, 14, 15, 16, 17, 18 Official docs
Last reviewed May 2025 Grounded in source

Symptoms

The server is not yet ready to accept connections.

  • The error is written to the server log and returned to the client carrying SQLSTATE 57P03.
  • Any driver (libpq, JDBC, psycopg, npgsql, pgx) surfaces this code in its error object so you can branch on it programmatically.
  • PL/pgSQL can trap it by name: EXCEPTION WHEN cannot_connect_now THEN.

Environment

Severity: ERROR  |  PostgreSQL versions: 12, 13, 14, 15, 16, 17

Commonly coincides with restarts, failover, maintenance, or network events; check server uptime and the log around the timestamp.

Root Cause

The server is starting up or in recovery (crash recovery, or a standby catching up).

Diagnostic Queries

Recovery

Steps to resolve 57P03:

  1. Wait and retry; this clears once startup or recovery completes.
  2. Check the log for recovery progress; for read access on a standby confirm hot_standby = on.

Reference: PostgreSQL error codes — Class 57 (Operator Intervention).

Was this helpful?