Hi,

During a code review, it was noticed that there are several places
within logical replication where a comma-separated list of publication
names is built explicitly. There is already a utility function (called
'get_publications_str') for doing this, but it was not being used in
every place it could have been.

This is a refactoring patch to make better use of the existing function.

Changes:

- The function has been moved and renamed to 'GetPublicationsStr'
because it is no longer static.

- Now function GetPublicationsStr is also being called from
tablesync.c, fetch_remote_table_info().

- I found fetch_remote_table_info() was building the same publication
list multiple times. In passing, fixed this to make the list only
once.

- Similarly, there was a duplicate list building code in
subscriptioncmds.c fetch_table_list(). Not a performance hit -- just
more code than needed. In passing, simplified this too.

~~~

Please take a look at the attached patch v1.

======
Kind Regards,
Peter Smith.
Fujitsu Australia

Attachment: v1-0001-Refactor-to-use-common-function-GetPublicationsSt.patch
Description: Binary data

Reply via email to