the database system is starting up

SQLSTATE 57P03 condition cannot_connect_now class 57 — Operator Intervention severity FATAL
Reproduced & verified on PostgreSQL 14.23, 15.18, 16.14, 17.10 and 18.4 — identical message on every version.
Last reviewed 30 May 2025 · Reproduced live with the SQL on this page.

Symptoms

A connection attempt arrived while the server was still starting (performing crash/archive recovery before accepting normal connections). PostgreSQL refuses with SQLSTATE 57P03 (cannot_connect_now).

What the server log shows

FATAL:  the database system is starting up

Why PostgreSQL raises this — what the manual says

As Section 18.5 Shutting Down the Server explains:

A connection arrived while the postmaster was still performing startup/recovery, so it cannot yet accept queries; the server replays WAL to reach a consistent state before it begins accepting normal connections.

On startup the postmaster runs recovery to bring the cluster to a consistent state before opening for connections. Until that completes, new connections are rejected with 57P03.

Common causes

How to fix it

  1. Wait and retry with backoff until the server finishes recovery.
  2. Make clients/pools tolerant of 57P03 during startup windows.
  3. If recovery is slow, investigate WAL volume and I/O throughput.

Related & next steps

Reference: PostgreSQL 18 Section 19.3 “Server Start/Shutdown”.