| From: | "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com> |
|---|---|
| To: | 'Fujii Masao' <masao(dot)fujii(at)gmail(dot)com>, Ajin Cherian <itsajin(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-08 10:52:35 |
| Message-ID: | OS9PR01MB12149EB1F6F301EDC8EFA1F55F5B12@OS9PR01MB12149.jpnprd01.prod.outlook.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Dear Fujii-san,
> The patched pg_createsubscriber seems to assume that the server
> supports output_plugin_libraries. However, a user may run a newer
> version of pg_createsubscriber against a server running an older minor
> version that does not yet support output_plugin_libraries (e.g., v18.4).
> So, for the v17 and v18 versions of pg_createsubscriber, it should handle
> this case?
>
>
> Previously, a non-superuser without permission to access
> output_plugin_libraries could run pg_createsubscriber successfully.
> But, with the patch, it fails with a permission denied error. I think
> we should avoid this, for example by skipping the check when the user
> doesn't have sufficient permission, rather than adding a new prerequisite
> for running pg_createsubscriber. Thoughts?
Good point, should be fixed. I came up with an idea to spedcify missing_ok := true
for current_setting(), and skip checking if it returns NULL. Thought?
> + /* Also check per-database settings on the publisher */
> + check_publisher_per_database(dbinfo);
>
> In the v19 and v20 patches, this check is called from
> check_publisher(), whereas in the v17 and v18 patches it is called from
> check_subscriber(). Could you tell me why they are different?
It was not intended.
The git am command on my env put the code at the wrong place, so it was the reason.
The function referred dbinfo[i].pubconninfo, so the behavior is the same. Moved
to the correct place.
Attached new patch set. I also noticed that max_slot_wal_keep_size is not checked
in PG17, so 0002 was removed.
Best regards,
Hayato Kuroda
FUJITSU LIMITED
| Attachment | Content-Type | Size |
|---|---|---|
| v4-0001-pg_createsubscriber-ensure-output_plugin_librarie.patch | application/octet-stream | 6.5 KB |
| v4-0002-free-allocated-memory-for-max_slot_wal_keep_size.patch | application/octet-stream | 737 bytes |
| v4-PG17-0001-pg_createsubscriber-ensure-output_plugin_lib.txt | text/plain | 6.5 KB |
| v4-PG18-0001-pg_createsubscriber-ensure-output_plugin_lib.txt | text/plain | 6.5 KB |
| v4-PG18-0002-free-allocated-memory-for-max_slot_wal_keep_.txt | text/plain | 742 bytes |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jakub Wartak | 2026-09-08 10:58:39 | Re: pg_threads.h take II |
| Previous Message | Jan Nidzwetzki | 2026-09-08 10:29:26 | Re: Re:[PATCH] Speed up repeat() for larger counts |