Thread

  1. Add --system-identifier / -s option to pg_resetwal

    Nikolay Samokhvalov <nik@postgres.ai> — 2025-05-31T18:52:19Z

    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