Re: Add --system-identifier / -s option to pg_resetwal - Mailing list pgsql-hackers

From Nikolay Samokhvalov
Subject Re: Add --system-identifier / -s option to pg_resetwal
Date
Msg-id CAM527d_xUH0Jug0Kf29Mt+tL89DoqANc6ZOit+BCy+x6GOwPgw@mail.gmail.com
Whole thread Raw
In response to Re: Add --system-identifier / -s option to pg_resetwal  (Fujii Masao <masao.fujii@oss.nttdata.com>)
List 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.fujii@oss.nttdata.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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: slow SELECT expr INTO var in plpgsql
Next
From: Maciek Sakrejda
Date:
Subject: Re: V18 change on EXPLAIN ANALYZE