Re: Add --system-identifier / -s option to pg_resetwal

From: Nikolay Samokhvalov <nik(at)postgres(dot)ai>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers mailing list <pgsql-hackers(at)postgresql(dot)org>, Andrey Borodin <amborodin(at)acm(dot)org>, Kirk Wolak <wolakk(at)gmail(dot)com>
Subject: Re: Add --system-identifier / -s option to pg_resetwal
Date: 2026-01-31 21:33:34
Message-ID: CAM527d_xUH0Jug0Kf29Mt+tL89DoqANc6ZOit+BCy+x6GOwPgw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thank you for the review!

Attached is v3 addressing your feedback:

- Changed label to "Database system identifier" for consistency
- Use PRIu64 instead of UINT64_FORMAT for gettext
- Moved option entry after "char-signedness" in getopt array
- Fixed test to use pg_controldata instead of pg_control_system()

On Wed, Jun 4, 2025 at 4:56 PM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
wrote:

> One question about this feature: why do we need to allow
> explicitly setting the system identifier? If the goal is
> simply to ensure it's different from the original,
> wouldn't it be sufficient to let pg_resetwal generate
> a new (hopefully unique) value using existing logic,
> like what's done in GuessControlValues() or BootStrapXLOG()?

Auto-generation would cover most cases. But explicit setting is a superset
-- users who want random can generate one themselves. Explicit control
costs nothing extra and gives full flexibility for edge cases (eg,
reproducible test environments, coordinating multiple clones). pg_resetwal
users are expected to be experts, so giving more control can cover more
possible scenarios.

Nik

Attachment Content-Type Size
v3-0001-Add-system-identifier-option-to-pg_resetwal.patch text/plain 6.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Maciek Sakrejda 2026-01-31 22:55:52 Re: V18 change on EXPLAIN ANALYZE
Previous Message Tom Lane 2026-01-31 20:58:34 Re: slow SELECT expr INTO var in plpgsql