| From: | "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com> |
|---|---|
| To: | 'Fujii Masao' <masao(dot)fujii(at)gmail(dot)com> |
| Cc: | "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "jacob(dot)champion(at)enterprisedb(dot)com" <jacob(dot)champion(at)enterprisedb(dot)com> |
| Subject: | RE: pg_createsubscriber does not check output_plugin_libraries |
| Date: | 2026-09-07 03:36:40 |
| Message-ID: | OS9PR01MB12149F3FF5696E19749E6C7E0F5B22@OS9PR01MB12149.jpnprd01.prod.outlook.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
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 | Content-Type | Size |
|---|---|---|
| v3-PG17-0001-pg_createsubscriber-ensure-output_plugin_lib.patch | application/octet-stream | 0 bytes |
| v3-PG17-0002-free-allocated-memory-for-max_slot_wal_keep_.patch | application/octet-stream | 0 bytes |
| v3-PG18-0001-pg_createsubscriber-ensure-output_plugin_lib.patch | application/octet-stream | 0 bytes |
| v3-PG18-0002-free-allocated-memory-for-max_slot_wal_keep_.patch | application/octet-stream | 0 bytes |
| v3-0001-pg_createsubscriber-ensure-output_plugin_librarie.patch | application/octet-stream | 0 bytes |
| v3-0002-free-allocated-memory-for-max_slot_wal_keep_size.patch | application/octet-stream | 0 bytes |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Hayato Kuroda (Fujitsu) | 2026-09-07 05:05:10 | RE: pg_createsubscriber does not check output_plugin_libraries |
| Previous Message | Chao Li | 2026-09-07 03:34:21 | Re: pg_createsubscriber: allow duplicate subscription names |