pg_resetwal: Fix handling of commit timestamp XIDs

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Subject: pg_resetwal: Fix handling of commit timestamp XIDs
Date: 2026-09-29 06:09:40
Message-ID: F61E486B-746B-42F3-A532-B8D4F1519583@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

While working on patch [1], I spotted two small issues in pg_resetwal.

1. The -c option accepts two XIDs. The first is parsed by strtouint32_strict(), but the second is parsed by strtoul(). This seems to be an oversight in 636c1914b48, which introduced strtouint32_strict().

2. The help message for the -c option says that “zero means no change”, but this behavior is missing on the current master branch. I checked the git history, and the behavior was lost in 978cf02bb8c, which added separate “given” flags for command-line options.

The fixes for both issues are tiny. See the attached patch for details.

Unfortunately, I reviewed both patches but didn't notice these issues at the time. Both commits were included in PG19, so this might be worth back-patching to 19.

[1] https://postgr.es/m/F7B47D8D-BFCB-464F-A737-DA796AE69D91@gmail.com

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

Attachment Content-Type Size
v1-0001-pg_resetwal-Fix-handling-of-commit-timestamp-XIDs.patch application/octet-stream 2.0 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message shihao zhong 2026-09-29 06:11:28 Re: Parallel vacuum: wrong error context when the leader vacuums an index
Previous Message Masahiko Sawada 2026-09-29 06:08:37 Re: Parallel vacuum: I/O timings in the log leave out the parallel workers