pgsql: pg_waldump: Preparatory refactoring for tar archive WAL decoding

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pg_waldump: Preparatory refactoring for tar archive WAL decoding
Date: 2026-03-20 19:32:10
Message-ID: E1w3fZp-000gjZ-2t@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

pg_waldump: Preparatory refactoring for tar archive WAL decoding.

Several refactoring steps in preparation for adding tar archive WAL
decoding support to pg_waldump:

- Move XLogDumpPrivate and related declarations into a new pg_waldump.h
header, allowing a second source file to share them.

- Factor out required_read_len() so the read-size calculation can be
reused for both regular WAL files and tar-archived WAL.

- Move the WAL segment size variable into XLogDumpPrivate and rename it
to segsize, making it accessible to the archive streamer code.

Author: Amul Sul <sulamul(at)gmail(dot)com>
Reviewed-by: Robert Haas <robertmhaas(at)gmail(dot)com>
Reviewed-by: Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>
Reviewed-by: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Reviewed-by: Euler Taveira <euler(at)eulerto(dot)com>
Reviewed-by: Andrew Dunstan <andrew(at)dunslane(dot)net>
discussion: https://postgr.es/m/CAAJ_b94bqdWN3h2J-PzzzQ2Npbwct5ZQHggn_QoYGhC2rn-=WQ@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/bin/pg_waldump/pg_waldump.c | 78 +++++++++++++++++++++++------------------
src/bin/pg_waldump/pg_waldump.h | 26 ++++++++++++++
2 files changed, 70 insertions(+), 34 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2026-03-20 19:44:54 pgsql: Fix dependency on FDW's connection function.
Previous Message Nathan Bossart 2026-03-20 19:16:30 pgsql: Bump transaction/multixact ID warning limits to 100M.