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