Re: Move system identifier generation to a common helper

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Imran Zaheer <imran(dot)zhir(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Move system identifier generation to a common helper
Date: 2026-06-10 13:25:30
Message-ID: f449b482-75e1-4678-9dd0-5fe03a0004e4@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 04.06.26 14:22, Imran Zaheer 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.

Then again, this code is from PG 8.0. We have had pg_strong_random()
required since PG 12. Maybe we should use that now for this.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message ZizhuanLiu X-MAN 2026-06-10 13:28:13 Re: Return value of XLogInsertRecord() for XLOG_SWITCH record
Previous Message Peter Eisentraut 2026-06-10 13:21:03 Re: Improve version detection for online help URL