57P01: admin_shutdown
PostgreSQLWhat does it mean?
Your active connection was terminated because of an administrator command. The client receives this error when the server is shutting down or the session is terminated manually ('terminating connection due to administrator command').
Why does it happen?
A DBA killed the session with pg_terminate_backend(); the server is being shut down in fast/immediate mode (smart shutdown does not kill sessions, it waits for them to finish); or existing connections were dropped for a configuration change/planned maintenance. In some failover scenarios the old primary also cuts connections this way.
How to fix it
This is usually not a permanent error; the application must reconnect (retry). If unexpected, investigate the shutdown/terminate reason in the server log. For planned maintenance, implement automatic reconnection and connection pool health checks in the application. The server log does not show who terminated a session; to trace pg_terminate_backend calls, keep an audit trail with log_statement (or pgaudit).