Re: Add missing stats_reset column to pg_stat_database_conflicts view

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Sami Imseih <samimseih(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add missing stats_reset column to pg_stat_database_conflicts view
Date: 2026-03-10 18:43:19
Message-ID: CAGRkXqQ0qBHTcD=UZ7_GTLsgn+W-=1c8suMJ3yWZb2eP4m0fBg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The patch has been rebased, and the documentation and catversion
updates have been added.

> I also noticed that pg_statio_all_sequences does not have a reset
> column. We should fix this one also. What do you think?

Right now the pg_statio_all_tables, pg_statio_all_indexes,
pg_statio_all_sequences, pg_stat_user_functions all do not have
reset_stat supported. I am actively working on tadd a reset_stat
support for these view. For now, let's quickly address the db conflict
first.

On Tue, Mar 10, 2026 at 7:32 AM Kirill Reshke <reshkekirill(at)gmail(dot)com> wrote:
>
> On Tue, 10 Mar 2026 at 06:17, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> >
> > On Tue, Mar 10, 2026 at 8:33 AM Sami Imseih <samimseih(at)gmail(dot)com> wrote:
> > >
> > > > The attached patch adds pg_stat_get_db_stat_reset_time() to fix this
> > > > inconsistency.
> > > >
> > > > Please let me know your thoughts.
> > >
> > > This view was introduced 15 years ago, and surprisingly this is the
> > > first complaint about this. I am also not very surprised.
> > >
> > > I also noticed that pg_statio_all_sequences does not have a reset
> > > column. We should fix this one also. What do you think?
> >
> > +1
> >
> > Also it might be better to update the docs together so that the description of
> > pg_stat_reset_single_table_counters mentions sequences in addition to
> > tables and indexes.
> >
> > Regards,
> >
> > --
> > Fujii Masao
> >
>
> Well, it looks like there are not so many users of this view. Anyway,
> +1 on change.
> This also need catversion bump
>
> --
> Best regards,
> Kirill Reshke

Attachment Content-Type Size
pg_stat_database_conflicts_v2.patch application/octet-stream 1.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2026-03-10 19:04:46 Re: Change initdb default to the builtin collation provider
Previous Message Tomas Vondra 2026-03-10 18:41:54 Re: Remove header lock BufferGetLSNAtomic() on architectures with 64 bit atomic operations