Re: pg_control_checkpoint(): add "data_checksum_version" (Pg19)?

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, Ian Lawrence Barwick <barwick(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_control_checkpoint(): add "data_checksum_version" (Pg19)?
Date: 2026-08-19 09:25:52
Message-ID: aoV2oIee3NtRDVCO@bdtpg
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Wed, Aug 19, 2026 at 05:51:07PM +0900, Fujii Masao wrote:
> On Wed, Aug 19, 2026 at 5:38 PM Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:
> > That's another option. I'm not a big fan of adapting new code to bugs of the
> > past, but at this point in the cycle there are other aspects in play as well.
> > I'll see what others think for a little bit before reverting.
>
> +1
>
> If I'm in the minority, i.e., the only one who doesn't like adding
> data_checksum_version_init and is concerned about the consistency
> between pg_control_xxx() and pg_controldata, I'm happy to withdraw my
> proposal.
>

dc7d70ea05d introduced pg_control_init() and documented from the start as returning
cluster initialization state.

Later ed308d78379 made the value changing through pg_checksums, without adjusting
pg_control_init() or its documentation. So, yeah, this looks like a regression.

So I think there is 2 kinds of users:

- Users expecting initialization state, as documented.
- Users treating it as current state. That contradicts the documented purpose.

I'm not sure we should "favor" the latter over the former, so FWIW, I'd vote for
keeping the committed fix.

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-08-19 09:43:20 Re: [PATCH] Fix heap-buffer-overflow in PGTYPEStimestamp_defmt_scan()
Previous Message Sivirilova Marija 2026-08-19 09:13:58 RE: [PATCH] Fix heap-buffer-overflow in PGTYPEStimestamp_defmt_scan()