SQLSTATE 57P03 FATAL Class 57: Operator Intervention

cannot_connect_now the database system is starting up — 57P03

PostgreSQL error “the database system is starting up — 57P03” (SQLSTATE 57P03): what it means, common causes, and how to fix it.

PG 9.6, 10, 11, 12, 13, 14, 15, 16, 17, 18 Official docs
Last reviewed Jun 2026 Grounded in source

Diagnostic Queries

Symptoms

A connection was refused because the server is still starting up (or performing crash recovery) and not yet ready to accept connections. PostgreSQL raises SQLSTATE 57P03 (cannot_connect_now).

  • The server is in startup/recovery.
  • Connections are temporarily refused.
  • Common right after a restart or crash recovery.

What the server log shows

FATAL:  the database system is starting up

Why PostgreSQL raises this — what the manual says

Section 18.3 Starting the Database Server:

“But a PostgreSQL server that might have to perform crash recovery at startup could take much longer to become ready.”

Before completing startup/recovery, the server cannot safely serve queries. It refuses connections with 57P03 until recovery finishes and it reaches a consistent, ready state.

Common causes

  • The server is replaying WAL during crash recovery.
  • A standby is still reaching a consistent recovery point.
  • A recently restarted server still initializing.

How to fix it

  1. Wait and retry; recovery time scales with the amount of WAL to replay.
  2. Monitor the server log for “database system is ready to accept connections”.
  3. If recovery is very long, investigate WAL volume and checkpoint settings.

Related & next steps

Reference: PostgreSQL 18 Section 19.3 “Starting the Server”.

Was this helpful?