pgsql: Refactor code of pg_stat_get_wal() building result tuple

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Refactor code of pg_stat_get_wal() building result tuple
Date: 2025-02-27 02:54:57
Message-ID: E1tnU35-000HQB-3D@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Refactor code of pg_stat_get_wal() building result tuple

This commit adds to pgstatfuncs.c a new routine called
pg_stat_wal_build_tuple(), helper routine for pg_stat_get_wal(). This
is in charge of filling one tuple based on the contents of
PgStat_WalStats retrieved from pgstats.

This refactoring will be used by an upcoming patch introducing
backend-level WAL statistics, simplifying the main patch. Note that
it is not possible for stats_reset to be NULL in pg_stat_wal; backend
statistics need to be able to handle this case.

Author: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Discussion: https://postgr.es/m/Z3zqc4o09dM/Ezyz(at)ip-10-97-1-34(dot)eu-west-3(dot)compute(dot)internal

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/495864a4cf16530c5174f264668c87b780c4cf22

Modified Files
--------------
src/backend/utils/adt/pgstatfuncs.c | 44 +++++++++++++++++++++++++------------
1 file changed, 30 insertions(+), 14 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Kapila 2025-02-27 03:26:01 pgsql: Doc: Additional clarification for -d option of pg_createsubscrib
Previous Message Michael Paquier 2025-02-27 00:45:34 pgsql: Fix possible double-release of spinlock in procsignal.c