57014: query_canceled
PostgreSQLWhat does it mean?
The query was cancelled. Usually caused by statement_timeout expiring or a cancel from the user or client (pg_cancel_backend, driver cancel).
Why does it happen?
statement_timeout exceeded, a cancel with pg_cancel_backend, or a cancel request sent by the application/client. Similar situations have different codes: lock_timeout expiry returns 55P03, idle_in_transaction_session_timeout 25P03 (FATAL), and a cancel caused by a replication conflict on a hot standby 40001 (40P01 in some cases).
How to fix it
If the query really takes long, tune it (EXPLAIN ANALYZE, indexes, plan). If the timeout is too low, adjust statement_timeout for the relevant session/role. Deliberate cancels need no action. For cancels caused by locks and standby conflicts, see the 55P03 and 40001 entries.