Add missing stats_reset column to pg_stat_database_conflicts view
shihao zhong <zhong950419@gmail.com>
From: shihao zhong <zhong950419@gmail.com>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2026-03-09T22:11:33Z
Lists: pgsql-hackers
Attachments
- pg_stat_database_conflict.patch (application/octet-stream) patch
Hi hackers, Currently, pg_stat_database and pg_stat_database_conflicts are decoupled into two separate views. However, there is an inconsistency: pg_stat_database_conflicts is missing the stats_reset column. Implementation wise, both views expose data from PgStat_StatDBEntry and share the same reset lifecycle when pg_stat_reset() is called. For now, users monitoring recovery conflicts have to get the reset time from pg_stat_database. I would like these two views to be purely decoupled to avoid such confusion. The attached patch adds pg_stat_get_db_stat_reset_time() to fix this inconsistency. Please let me know your thoughts. Thanks, Shihao
Commits
-
Simplify redundant current_database() subqueries in stats.sql regression test
- d78a4f0bf058 19 (unreleased) landed
-
Add stats_reset column to pg_stat_database_conflicts.
- 723619eaa3a8 19 (unreleased) landed