Summary
The pg_stat_database_conflicts view will contain one row per database, showing database-wide statistics about query cancels occurring due to conflicts with recovery on standby servers. This view will only contain information on standby servers, since conflicts do not occur on primary servers.
(Description quoted from the official PostgreSQL documentation.)
Columns
The pg_stat_database_conflicts statistics view exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):
datidoid
OID of a databasedatnamename
Name of this databaseconfl_tablespacebigint
Number of queries in this database that have been canceled due to dropped tablespacesconfl_lockbigint
Number of queries in this database that have been canceled due to lock timeoutsconfl_snapshotbigint
Number of queries in this database that have been canceled due to old snapshotsconfl_bufferpinbigint
Number of queries in this database that have been canceled due to pinned buffersconfl_deadlockbigint
Number of queries in this database that have been canceled due to deadlocksconfl_active_logicalslotbigint
Number of uses of logical slots in this database that have been canceled due to old snapshots or too low a wal_level on the primarystats_resettimestamp with time zone
Time at which these statistics were last reset
Version applicability
Present in PostgreSQL 17, 18, 19 (verified against each release’s documentation). This is a long-standing system object that also exists in earlier PostgreSQL releases.
Related & references
Reference: PostgreSQL documentation — pg_stat_database_conflicts.