# Postgres error 57P01: terminating connection due to administrator command

> The server terminated this session, usually during a restart, a failover, scaling, or pg_terminate_backend.

Source: https://scribase.com/postgres-errors/57p01

SQLSTATE class: Operator Intervention. Over PostgREST/supabase-js this maps to HTTP 500.

## Causes

- Planned maintenance, a restart after a configuration change, or a serverless database scaling down.
- An administrator or a watchdog ended long idle sessions.

## Fixes

- Reconnect and retry. Make sure your pool discards broken connections and opens new ones.