pgsql: Add data_page_checksum_version to pg_control_checkpoint

From: Daniel Gustafsson <dgustafsson(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add data_page_checksum_version to pg_control_checkpoint
Date: 2026-08-18 20:41:16
Message-ID: E1wwQcV-000000016st-0BZz@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add data_page_checksum_version to pg_control_checkpoint

Commit f19c0eccae added the data_checksum_version to the pg_controldata
output, but omitted a corresponding change to the pg_control_checkpoint
SQL function, which reports the same checkpoint information. The field
is named to match what pg_control_init already reports for consistency.

The integer version reported is an implementation detail which bleeds
through, but it is quite widely used and a more holistic approach to
improving this is left as an excercise for the next major version. The
mapping between states and versions is added to the documentation to
make it easier for users.

Backpatch to v19 where online checksums were introduced.

Author: Ian Barwick <barwick(at)gmail(dot)com>
Co-authored-by: Daniel Gustafsson <daniel(at)yesql(dot)se>
Reviewed-by: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Reviewed-by: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Reviewed-by: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAB8KJ=hb765sE8bKC-6sh=Yp3sCjN8xs474yuBrkwyoTM2pgZA@mail.gmail.com
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/397f0fd06edc3a5b114449164c5d39c59a468b61

Modified Files
--------------
doc/src/sgml/func/func-info.sgml | 5 +++
doc/src/sgml/wal.sgml | 45 +++++++++++++++++++++++-
src/backend/utils/misc/pg_controldata.c | 9 +++--
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_proc.dat | 6 ++--
src/test/modules/test_checksums/t/001_basic.pl | 18 ++++++++++
src/test/modules/test_checksums/t/004_offline.pl | 12 +++++++
7 files changed, 89 insertions(+), 8 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Masahiko Sawada 2026-08-18 20:57:40 pgsql: test_decoding: Don't print virtual generated columns.
Previous Message Daniel Gustafsson 2026-08-18 20:40:39 pgsql: Minor test suite cleanup