pg_stat_database_conflicts — PostgreSQL statistics view

The PostgreSQL pg_stat_database_conflicts statistics view: full column reference (names, types, descriptions), catalog relationships and version support.

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):

  • datid oid
    OID of a database
  • datname name
    Name of this database
  • confl_tablespace bigint
    Number of queries in this database that have been canceled due to dropped tablespaces
  • confl_lock bigint
    Number of queries in this database that have been canceled due to lock timeouts
  • confl_snapshot bigint
    Number of queries in this database that have been canceled due to old snapshots
  • confl_bufferpin bigint
    Number of queries in this database that have been canceled due to pinned buffers
  • confl_deadlock bigint
    Number of queries in this database that have been canceled due to deadlocks
  • confl_active_logicalslot bigint
    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 primary
  • stats_reset timestamp 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.