agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refactor pg_stat_get_lock() to use a helper function
Date: Tue, 30 Jun 2026 07:30:19 +0000
Message-ID: <E1weSvD-000kgV-2B@gemulon.postgresql.org> (raw)

Refactor pg_stat_get_lock() to use a helper function

This commit extracts the tuple-building logic from pg_stat_get_lock()
into a new static helper pg_stat_lock_build_tuples().  This is in
preparation for a follow-up patch, to add support for backend-level lock
stats, which will reuse the same helper.

This change follows the pattern established by pg_stat_io_build_tuples()
for IO stats and pg_stat_wal_build_tuple() for WAL stats.

Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Reviewed-by: Tatsuya Kawata <kawatatatsuya0913@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Tristan Partin <tristan@partin.io>
Reviewed-by: Rui Zhao <zhaorui126@gmail.com>
Discussion: https://postgr.es/m/aiAzEY+cMQb/W8yu@bdtpg

Branch
------
master

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

Modified Files
--------------
src/backend/utils/adt/pgstatfuncs.c | 47 ++++++++++++++++++++++++-------------
1 file changed, 31 insertions(+), 16 deletions(-)



Message-ID: <E1weSvD-000kgV-2B@gemulon.postgresql.org>
Permalink:  ../E1weSvD-000kgV-2B@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1weSvD-000kgV-2B@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: Refactor pg_stat_get_lock() to use a helper function
  In-Reply-To: <E1weSvD-000kgV-2B@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox