pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add stats_reset to pg_stat_user_functions
Date: Wed, 08 Oct 2025 03:43:52 +0000
Message-ID: <E1v6L5k-000brn-1p@gemulon.postgresql.org> (raw)

Add stats_reset to pg_stat_user_functions

It is possible to call pg_stat_reset_single_function_counters() for a
single function, but the reset time was missing the system view showing
its statistics.  Like all the fields of pg_stat_user_functions, the GUC
track_functions needs to be enabled to show the statistics about
function executions.

Bump catalog version.
Bump PGSTAT_FILE_FORMAT_ID, as a result of the new field added to
PgStat_StatFuncEntry.

Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Discussion: https://postgr.es/m/aONjnsaJSx-nEdfU@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b71bae41a0cdda879db39d9946d2cc4af910bed1

Modified Files
--------------
doc/src/sgml/monitoring.sgml                 |  9 +++++++++
src/backend/catalog/system_views.sql         |  3 ++-
src/backend/utils/activity/pgstat.c          |  1 +
src/backend/utils/activity/pgstat_function.c |  6 ++++++
src/backend/utils/adt/pgstatfuncs.c          | 18 ++++++++++++++++++
src/include/catalog/catversion.h             |  2 +-
src/include/catalog/pg_proc.dat              |  4 ++++
src/include/pgstat.h                         |  3 ++-
src/include/utils/pgstat_internal.h          |  1 +
src/test/isolation/expected/stats.out        | 20 +++++++++++++++++++-
src/test/isolation/expected/stats_1.out      | 20 +++++++++++++++++++-
src/test/isolation/specs/stats.spec          |  8 ++++++--
src/test/regress/expected/rules.out          |  3 ++-
13 files changed, 90 insertions(+), 8 deletions(-)



Message-ID: <E1v6L5k-000brn-1p@gemulon.postgresql.org>
Permalink:  ../E1v6L5k-000brn-1p@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1v6L5k-000brn-1p@gemulon.postgresql.org

 · 

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: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add stats_reset to pg_stat_user_functions
  In-Reply-To: <E1v6L5k-000brn-1p@gemulon.postgresql.org>

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

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