Add --system-identifier / -s option to pg_resetwal
Nikolay Samokhvalov <nik@postgres.ai>
From: Nikolay Samokhvalov <nik@postgres.ai>
To: pgsql-hackers mailing list <pgsql-hackers@postgresql.org>
Date: 2025-05-31T18:52:19Z
Lists: pgsql-hackers
Attachments
- 0001-pg_resetwal--system-identifier.patch (application/octet-stream)
hi hackers, I was just involved in a DR case, where we needed to change system ID in control data, and noticed that there is no such capability, officially – so I thought, it would be good to have it the attached patch adds a new -s / --system-identifier option to pg_resetwal that allows users to change the database cluster's system identifier; it can be useful when you need to make a restored cluster distinct from the original, or when cloning for testing some aspects about the patch: - accepts positive 64-bit integers only (zero not allowed) - requires interactive confirmation or --force flag for safety - detects non-TTY environments and requires --force in scripts - included input validation and error handling - updated docs with clear warnings about compatibility - added tests, including some edge cases looking forward to hearing feedback! Nik