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

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Ian Lawrence Barwick <barwick(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(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-10 21:50:27
Message-ID: 9AC7877C-EE1C-4824-9C48-3F3D1258D074@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Aug 11, 2026, at 02:07, Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:
>
>> On 10 Aug 2026, at 16:21, Ian Lawrence Barwick <barwick(at)gmail(dot)com> wrote:
>> 2026年8月10日(月) 22:30 Fujii Masao <masao(dot)fujii(at)gmail(dot)com>:
>
>>> On Mon, Aug 10, 2026 at 9:39 PM Ian Lawrence Barwick <barwick(at)gmail(dot)com> wrote:
>>>> The function "get_checksum_state_string()" which performs the conversion is in
>>>> src/backend/access/rmgrdesc/xlogdesc.c, which AFAIR can't be linked from
>>>> frontend utilities, so we'd either have to move that somewhere else (maybe
>>>> src/common/controldata_utils.c?) or duplicate it.
>
> I originally opted against displaying the mapped name to keep
> pg_control_checkpoint a way to extract the raw data, but thinking about it
> might be more useful to show the mapped value since the mapping is private.
>
>>> Agreed. I think moving it to common is better than duplicating the mapping.
>>>
>>> src/common/controldata_utils.c seems like a reasonable place, since
>>> this state is stored in the control/checkpoint data and both pg_controldata
>>> and pg_control_checkpoint() already use controldata_utils.
>>
>> TBH it feels a little odd there because it's not really specific to
>> the controldata output functions, but it has to go somewhere, I guess.
>
> Yeah, I'm not convinced it's the right place but that being said I also don't
> have a better idea yet. If I can't think of a better place by the time the
> tree is open I say we go with this placement.
>

I don’t see a better place either.

Overall, v3 looks good to me. I only have one small comment. Since get_checksum_state_string() has been moved to a common location and can be called by both frontend and backend code, would it be better to give it a more specific name, such as get_data_checksum_state_string()?

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message surya poondla 2026-08-10 22:20:20 Re: Missing list_free in publicationcmds.c:OpenTableList
Previous Message Chao Li 2026-08-10 21:24:52 Re: Fix detection of truncated zstd-compressed backups