terminating connection due to administrator command

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

Symptoms

A session was terminated by an administrator command (e.g. pg_terminate_backend() or a fast shutdown). PostgreSQL raises SQLSTATE 57P01 (admin_shutdown).

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

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”.