public inbox for [email protected]  
help / color / mirror / Atom feed
From: Chao Li <[email protected]>
To: Fujii Masao <[email protected]>
Cc: shihao zhong <[email protected]>
Cc: Sami Imseih <[email protected]>
Cc: Kirill Reshke <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: Add missing stats_reset column to pg_stat_database_conflicts view
Date: Thu, 12 Mar 2026 14:04:39 +0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAHGQGwHaHnRrz9hqpDdn984mqToJDdkjMRVvEXXgFwCnXJb89Q@mail.gmail.com>
References: <CAGRkXqS98OebEWjax99_LVAECsxCB8i=BfsdAL34i-5QHfwyOQ@mail.gmail.com>
	<CAA5RZ0vSjCEAuKXhxacnp0ftrYkf9QRcyPK-AvTi_otFVDWphA@mail.gmail.com>
	<CAHGQGwEeGUQtj7TOznM2_O2uV-g6iOa1UBBTBfyugJ-nSoS89Q@mail.gmail.com>
	<CALdSSPi4apueVqgnJEZqpy6O0HSEPUiUzf=vTLPPijsQLob2Eg@mail.gmail.com>
	<CAGRkXqQ0qBHTcD=UZ7_GTLsgn+W-=1c8suMJ3yWZb2eP4m0fBg@mail.gmail.com>
	<CAA5RZ0ta3y==2AStFyo-SYyJ2ztd3ZiurN1HQR9gzDTKVtgUDg@mail.gmail.com>
	<CAGRkXqRVDuhXNCvQ=j-+5KCu+Gcar_h5OeHTaMaVKF-FLV2YvQ@mail.gmail.com>
	<CAHGQGwHaHnRrz9hqpDdn984mqToJDdkjMRVvEXXgFwCnXJb89Q@mail.gmail.com>



> On Mar 12, 2026, at 12:50, Fujii Masao <[email protected]> wrote:
> 
> On Wed, Mar 11, 2026 at 11:10 PM shihao zhong <[email protected]> wrote:
>> Thanks for pointing that out. I've added new tests and used git
>> format-patch to generate a new patch.
> 
> Thanks for updating the patch!
> 
> +-- Test that the stats_reset column in pg_stat_database_conflicts is
> correctly maintained
> +SELECT pg_stat_reset();
> +SELECT stats_reset IS NOT NULL AS has_stats_reset
> +  FROM pg_stat_database_conflicts WHERE datname = current_database();
> 
> Since stats.sql already includes tests verifying that reset works for
> pg_stat_database, it might be better to add the test for
> pg_stat_database_conflicts alongside those, rather than at the end of
> stats.sql. Thought? The attached updated patch does that.
> 
> I also fixed some indentation issues in the docs in the patch.
> 
> Regards,
> 
> -- 
> Fujii Masao
> <v4-0001-Add-stats_reset-column-to-pg_stat_database_confli.patch>

V4 overall LGTM. A couple of nitpicks:

1 - stats.sql
```
+WHERE D.datname = (SELECT current_database()) AND D.datname = DC.datname \gset

+WHERE D.datname = (SELECT current_database()) AND D.datname = DC.datname;
```

(SELECT current_database()) can be just current_database(). I tried to fix this in my local, and the fix works for me.

2 - stats.sql
```
+-- Since stats_reset in pg_stat_database and pg_stat_database_conflicts starts
+-- out as NULL, reset it once first so we have something to compare it to
```

I think “starts” should be “start”, because there are two stats_reset fields from two tables in this context.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/









view thread (24+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Add missing stats_reset column to pg_stat_database_conflicts view
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox