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: Replace hardcoded identifiers of pgstats file by #defines
Date: Wed, 03 Jul 2024 04:11:39 +0000
Message-ID: <E1sOrLG-00071s-7j@gemulon.postgresql.org> (raw)

Replace hardcoded identifiers of pgstats file by #defines

This changes pgstat.c so as the three types of entries that can exist in
a pgstats file are not hardcoded anymore, replacing them with
descriptively-named macros, when reading and writing stats files:
- 'N' for named entries, like replication slot stats.
- 'S' for entries identified by a hash.
- 'E' for the end-of-file

This has come up while working on making this area of the code more
pluggable.  The format of the stats file is unchanged, hence there is no
need to bump PGSTAT_FILE_FORMAT_ID.

Reviewed-by: Bertrand Drouvot
Discussion: https://postgr.es/m/Zmqm9j5EO0I4W8dx@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9fd02525793f3e06c72ee0da45303c21f7067ccf

Modified Files
--------------
src/backend/utils/activity/pgstat.c | 28 ++++++++++++++++++++--------
1 file changed, 20 insertions(+), 8 deletions(-)



Message-ID: <E1sOrLG-00071s-7j@gemulon.postgresql.org>
Permalink:  ../E1sOrLG-00071s-7j@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1sOrLG-00071s-7j@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: Replace hardcoded identifiers of pgstats file by #defines
  In-Reply-To: <E1sOrLG-00071s-7j@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