the database system is not yet accepting connections

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 9 Jun 2026 · Reproduced live with the SQL on this page.

Symptoms

A statement failed with SQLSTATE 57P03 (cannot_connect_now), reported at severity FATAL. This is a Operator Intervention condition: PostgreSQL emits the message the database system is not yet accepting connections.

What the server log shows

FATAL:  the database system is not yet accepting connections
DETAIL:  Consistent recovery state has not been yet reached.
HINT:  To enable hot standby, close write transactions with more than n subtransactions on the primary server.

Why PostgreSQL raises this

Class 57 (Operator Intervention) is raised when an administrator action or server lifecycle event interrupts the session — shutdown, cancellation, or a forced termination.

As described in PostgreSQL’s Section 19.6 Error Handling and Appendix A (PostgreSQL Error Codes), SQLSTATE 57P03 carries the condition name cannot_connect_now in class Operator Intervention. (Paraphrased — see the linked reference for the exact wording.)

Common causes

How to fix it

  1. Retry once the server is available again.
  2. Investigate why the backend was cancelled/terminated.
  3. Tune the relevant timeout if cancellations are unintended.

Version applicability

This message is present in PostgreSQL 15, 16, 17, 18 and 19.

Related & next steps

Reference: PostgreSQL Section 19.6 Error Handling.