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

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: 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-13 10:17:16
Message-ID: B87ABFBE-A304-4839-8706-C80D73E6BF5C@yesql.se
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 12 Aug 2026, at 02:29, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>
> On Tue, Aug 11, 2026 at 11:56 PM Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:
>> I'm leaning towards using an integer representation in v19, which is the safe
>> option, and rethink it for v20 when we can consider it without any rush. A
>> compromise could be do document the integer <=> state name mapping in the
>> checksums section in the docs.
>
> +1 to keep using "version" for now and clarify the mapping in the docs.

I took a stab at fixing this today and in doing so I realized another issue
which isn't directly related to online checksums but also affect the offline
checksums available in all supported versions. pg_control_init is documented
to return the state at cluster initialization, but the checksum version in the
controlfile is overwritten when changed, and the original value is lost. The
attached 0001 fixes this by adding a new field to the controlfile. I think
this should be backpatched to 19, but it could also be argued against that at
this point in the cycle since it's a pre-existing regression (especially since
it updates the controlfile format).

The 0002 use data_page_checksum_version consistently, adds a mapping table to
the documentation and fixes the tests.

--
Daniel Gustafsson

Attachment Content-Type Size
v4-0001-Record-initial-state-of-data-checksums-in-control.patch application/octet-stream 3.2 KB
v4-0002-Add-data_page_checksum_version-to-pg_control_chec.patch application/octet-stream 8.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2026-08-13 10:24:12 [PATCH] Remove dead code in pgcrypto
Previous Message Jakub Wartak 2026-08-13 10:09:59 Re: CI slowdown due to PG_TEST_INITDB_EXTRA_OPTS