Add common function ReplicationOriginName. - Mailing list pgsql-hackers

From Peter Smith
Subject Add common function ReplicationOriginName.
Date
Msg-id CAHut+Psa8hhfSE6ozUK-ih7GkQziAVAf4f3bqiXEj2nQiu-43g@mail.gmail.com
Whole thread Raw
Responses Re: Add common function ReplicationOriginName.
List pgsql-hackers
Hi.

There are already multiple places that are building the subscription
origin name, and there are more coming with some new patches [1] doing
the same:

e.g.
snprintf(originname, sizeof(originname), "pg_%u", subid);

~~

IMO it is better to encapsulate this name formatting in common code
instead of the format string being scattered around the place.

PSA a patch to add a common function ReplicationOriginName. This is
the equivalent of a similar function for tablesync
(ReplicationOriginNameForTablesync) which already existed.

------
[1] https://www.postgresql.org/message-id/flat/CAA4eK1%2BwyN6zpaHUkCLorEWNx75MG0xhMwcFhvjqm2KURZEAGw%40mail.gmail.com

Kind Regards,
Peter Smith.
Fujitsu Australia

Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [RFC] building postgres with meson - v13
Next
From: "houzj.fnst@fujitsu.com"
Date:
Subject: Fix typos in code comments