Admin Shutdown — SQLSTATE 57P01

SQLSTATE 57P01 condition admin_shutdown 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 29 May 2025 · Reproduced live with the SQL on this page.

! Symptoms Free

The connection was terminated by an administrator command or server shutdown.

  • The error is written to the server log and returned to the client carrying SQLSTATE 57P01.
  • Any driver (libpq, JDBC, psycopg, npgsql, pgx) surfaces this code in its error object so you can branch on it programmatically.

1 Environment & reproduce Free

Severity: FATAL  |  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 Free

The backend received a terminate (pg_terminate_backend) or the server shut down/restarted.

Common causes:

  • A maintenance restart.
  • A failover.
  • A manual session termination.
  • A configuration change requiring restart.

3 Recovery & verify Free

Steps to resolve 57P01:

  1. Expect this during deploys and failover; add automatic reconnect with backoff.
  2. Coordinate maintenance windows and drain connections before restarts.

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