pgsql: pg_resetwal: Fix handling of commit timestamp XIDs

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pg_resetwal: Fix handling of commit timestamp XIDs
Date: 2026-09-29 13:50:04
Message-ID: E1xBYDc-00000001kwt-3HF0@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

pg_resetwal: Fix handling of commit timestamp XIDs

The help text for -c option documents that zero for either transaction
ID means to leave the corresponding value unchanged. Commit
978cf02bb8c replaced the separate checks for the two values with a
single flag indicating that the option was specified, causing zero to
be written to the control file instead.

Also parse the second transaction ID with strtouint32_strict(), like
the first one. Using strtoul() there was an oversight in commit
636c1914b48, which intended to reject negative and out-of-range
arguments.

Author: Chao Li <lic(at)highgo(dot)com>
Discussion: https://www.postgresql.org/message-id/F61E486B-746B-42F3-A532-B8D4F1519583@gmail.com
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1f7013fe089d0e0db5b5e4a20d84acecf0f128a1

Modified Files
--------------
src/bin/pg_resetwal/pg_resetwal.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2026-09-29 15:11:27 pgsql: Prevent self-join elimination when RTEs' checkAsUser fields diff
Previous Message David Rowley 2026-09-29 13:19:21 pgsql: Doc: add missing new line in DO example block