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_checksums: Use new routine to retrieve data of PG_VERSION
Date: Mon, 20 Oct 2025 00:36:06 +0000
Message-ID: <E1vAdsc-002WvX-2F@gemulon.postgresql.org> (raw)

pg_checksums: Use new routine to retrieve data of PG_VERSION

Previously, attempting to use pg_checksums on a cluster with a control
file whose version does not match with what thetool is able to support
would lead to the following error:
pg_checksums: error: pg_control CRC value is incorrect

This is confusing, because it would look like the control file is
corrupted.  However, the contents of the control file are correct,
pg_checksums not being able to understand how the past control file is
shaped.

This commit adds a check based on PG_VERSION, using the facility added
by cd0be131ba6f, using the same error message as some of the other
frontend tools.  A note is added in the documentation about the major
version requirement.

Author: Michael Banck <mbanck@gmx.net>
Discussion: https://postgr.es/m/68f1ff21.170a0220.2c9b5f.4df5@mx.google.com

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/ref/pg_checksums.sgml  |  4 ++++
src/bin/pg_checksums/pg_checksums.c | 17 +++++++++++++++++
2 files changed, 21 insertions(+)



Message-ID: <E1vAdsc-002WvX-2F@gemulon.postgresql.org>
Permalink:  ../E1vAdsc-002WvX-2F@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vAdsc-002WvX-2F@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_checksums: Use new routine to retrieve data of PG_VERSION
  In-Reply-To: <E1vAdsc-002WvX-2F@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