Dear Fujii-san,

> I found that output_plugin_libraries is PGC_SUSET, so its value may
> differ between databases. But, with the patch, pg_createsubscriber
> seems to check output_plugin_libraries only in the database specified by
> conninfo, not in the databases specified by --database, where the
> subscriptions are actually created.
> 
> If output_plugin_libraries does not include pgoutput in one of the
> databases specified by --database, --dry-run could succeed, while the
> actual run could fail because pgoutput is not allowed in that database.
> Isn't this a problem?

Right. After considering more, ALTER DATABASE SET command allows to set
different parameters for new connections.
I added check_publisher_per_database() to iterate all databases and check the 
parameter.
Alternative way I considered was to put in setup_publisher() because it also
connects to all given databases, but I preferred to handle at the verification
phase.

> -  # Note that src/bin/pg_upgrade/check.c assumes GUC_LIST_QUOTE here.
> +  # Note that src/bin/pg_upgrade/check.c and
> src/bin/pg_basebackup/pg_createsubscriber.c assume GUC_LIST_QUOTE
> here.
> 
> For the v18 patch, should the corresponding comment also be updated in
> src/backend/utils/misc/guc_tables.c?

Fixed.

> What about v17? We should backpatch this to v17 as well, since both
> output_plugin_libraries and pg_createsubscriber are supported there?

Right. I misunderstood that the command was introduced in PG18.
Attached accordingly.

Best regards,
Hayato Kuroda
FUJITSU LIMITED

Attachment: v3-PG17-0001-pg_createsubscriber-ensure-output_plugin_lib.patch
Description: v3-PG17-0001-pg_createsubscriber-ensure-output_plugin_lib.patch

Attachment: v3-PG17-0002-free-allocated-memory-for-max_slot_wal_keep_.patch
Description: v3-PG17-0002-free-allocated-memory-for-max_slot_wal_keep_.patch

Attachment: v3-PG18-0001-pg_createsubscriber-ensure-output_plugin_lib.patch
Description: v3-PG18-0001-pg_createsubscriber-ensure-output_plugin_lib.patch

Attachment: v3-PG18-0002-free-allocated-memory-for-max_slot_wal_keep_.patch
Description: v3-PG18-0002-free-allocated-memory-for-max_slot_wal_keep_.patch

Attachment: v3-0001-pg_createsubscriber-ensure-output_plugin_librarie.patch
Description: v3-0001-pg_createsubscriber-ensure-output_plugin_librarie.patch

Attachment: v3-0002-free-allocated-memory-for-max_slot_wal_keep_size.patch
Description: v3-0002-free-allocated-memory-for-max_slot_wal_keep_size.patch

Reply via email to