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: pg_resetwal: Use new routine to retrieve data of PG_VERSION
Date: Wed, 15 Oct 2025 01:18:33 +0000
Message-ID: <E1v8q9x-001jsJ-2u@gemulon.postgresql.org> (raw)

pg_resetwal: Use new routine to retrieve data of PG_VERSION

pg_resetwal's custom logic to retrieve the version number of a data
folder's PG_VERSION can be replaced by the facility introduced in
cd0be131ba6f.  This removes some code.

One thing specific to pg_resetwal is that the first line of PG_VERSION
is read and reported in the error report generated when the major
version read does not match with the version pg_resetwal has been
compiled with.  The new logic preserves this property, without changes
to neither the error message nor the data used in the error report.

Note that as a chdir() is done within the data folder before checking the
data of PG_VERSION, get_pg_version() needs to be tweaked to look for
PG_VERSION in the current folder.

Author: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Discussion: https://postgr.es/m/aOiirvWJzwdVCXph@paquier.xyz

Branch
------
master

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

Modified Files
--------------
src/bin/pg_resetwal/pg_resetwal.c | 30 +++++++-----------------------
1 file changed, 7 insertions(+), 23 deletions(-)



Message-ID: <E1v8q9x-001jsJ-2u@gemulon.postgresql.org>
Permalink:  ../E1v8q9x-001jsJ-2u@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1v8q9x-001jsJ-2u@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: pg_resetwal: Use new routine to retrieve data of PG_VERSION
  In-Reply-To: <E1v8q9x-001jsJ-2u@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