SQLSTATE 57P01 FATAL Class 57: Operator Intervention

admin_shutdown terminating connection due to administrator command — 57P01

PostgreSQL error “terminating connection due to administrator command — 57P01” (SQLSTATE 57P01): 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 session was terminated by an administrator command (e.g. pg_terminate_backend() or a fast shutdown). PostgreSQL raises SQLSTATE 57P01 (admin_shutdown).

  • The connection was terminated by an admin action.
  • Common during fast shutdown or manual session termination.
  • Distinct from a crash.

What the server log shows

FATAL:  terminating connection due to administrator command

Why PostgreSQL raises this — what the manual says

Section 9.28.2 Server Signaling Functions:

“pg_cancel_backend and pg_terminate_backend send signals (SIGINT or SIGTERM respectively) to backend processes identified by process ID.”

Administrative actions — pg_terminate_backend(), a fast/immediate shutdown, or signals — ask backends to exit. The affected session ends and reports 57P01.

Common causes

  • An admin ran pg_terminate_backend(pid).
  • A fast shutdown of the server.
  • Management tooling recycling connections.

How to fix it

  1. Reconnect; this is an intentional termination, not an error in your query.
  2. If unexpected, check who/what terminated the session (logs, automation).
  3. Make the application resilient to administrative disconnects.

Related & next steps

Reference: PostgreSQL 18 Section 9.28 “System Administration Functions”.

Was this helpful?