Re: Add stats_reset to pg_stat_all_tables|indexes and related views

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: Sami Imseih <samimseih@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2025-10-06T06:37:18Z
Lists: pgsql-hackers
On Mon, Oct 06, 2025 at 03:33:41PM +0900, Michael Paquier wrote:
> And applied this one as well after a few tweaks, mainly consistency in
> the code, with what should be the proper format bumps (thanks for the
> notes in your proposed commit message). 

And I forgot to mention something: now the only stats kind that does
not have a reset timestamp callback but has a SQL function able to do
resets is PGSTAT_KIND_FUNCTION.  Is it worth caring about doing
something for this case as well?
--
Michael

Commits

  1. Add stats_reset to pg_stat_user_functions

  2. Add stats_reset to pg_stat_all_{tables,indexes} and related views

  3. Add test for pg_stat_reset_single_table_counters() on index