Re: Move system identifier generation to a common helper - Mailing list pgsql-hackers

From John Naylor
Subject Re: Move system identifier generation to a common helper
Date
Msg-id CANWCAZaaUORye955Qmmv7vXahSoKCBwHLxKmTtkRG-vA4e5FkQ@mail.gmail.com
Whole thread
In response to Move system identifier generation to a common helper  (Imran Zaheer <imran.zhir@gmail.com>)
List pgsql-hackers
On Thu, Jun 4, 2026 at 7:22 PM Imran Zaheer <imran.zhir@gmail.com> wrote:
> The code used to generate a new system identifier is duplicated in
> multiple locations, including BootStrapXLOG(), pg_createsubscriber, and
> pg_resetwal.
>
> Move the generation logic into a common GenerateSystemIdentifier()
> helper so that all callers use a single implementation, avoiding
> duplication of the same algorithm.

This seems like a useful cleanup, and the first step to take if we end
up using any of the ideas in this thread at some point.

I'm not really a fan of creating a new C file and new header for just
one function. Maybe there's an existing logical place for it?

--
John Naylor
Amazon Web Services



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: Stop asserting that Unicode normalization consumes its whole input
Next
From: Chao Li
Date:
Subject: Re: Adding a range check on the sequence index from the publisher.