RE: pg_createsubscriber does not check output_plugin_libraries

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: 'Jacob Champion' <jacob(dot)champion(at)enterprisedb(dot)com>, 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>
Subject: RE: pg_createsubscriber does not check output_plugin_libraries
Date: 2026-09-09 10:33:39
Message-ID: OS9PR01MB12149E6DB23FD6B53CCC64403F5B02@OS9PR01MB12149.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear Fujii-san, Jacob,

Thanks for giving feedbacks. I'm confusing and let me confirm few points.
The situation might be different before and after the PG19.

For PG17 and 18, FOR ALL TABLES publications for publisher databases,
it meant superuser is required for the connection. IIUC superuser can bypass all
permission checks thus it might be OK not to check these points.
(We may have to check it though).
As for the PG19 and HEAD, we allowed to re-use existing publications [1], it
effectively allowed to use non-superuser for connecting to the publisher.
However it meant additional permission checks might be needed like Jacob pointed
out.

In this thread I do not want to broaden for other points and focus on the added
GUC, thought? In other threads we can improve --check option more.

Based on that, permission check is actually needed for PG19/HEAD same check
Fujii-san pointed out. For PG18/17, we may not have to take care the usage of
current_setting() but same code is used for better understanding. Attached patch
set does accordingly. v5-0001 also has a test for the case just in case, but not
sure it should be pushed.

[1]: https://github.com/postgres/postgres/commit/85ddcc2f4cdef490276d151c80459e287bceb782

Best regards,
Hayato Kuroda
FUJITSU LIMITED

Attachment Content-Type Size
v5-PG17-0001-pg_createsubscriber-ensure-output_plugin_lib.txt text/plain 6.5 KB
v5-PG18-0001-pg_createsubscriber-ensure-output_plugin_lib.txt text/plain 6.5 KB
v5-PG18-0002-free-allocated-memory-for-max_slot_wal_keep_.txt text/plain 742 bytes
v5-0001-pg_createsubscriber-ensure-output_plugin_librarie.patch application/octet-stream 7.8 KB
v5-0002-free-allocated-memory-for-max_slot_wal_keep_size.patch application/octet-stream 737 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthias van de Meent 2026-09-09 10:44:19 Re: Bug: Whole-row var in indexes corrupts indexes after DDL
Previous Message Álvaro Herrera 2026-09-09 10:20:22 Re: Race conditions in logical decoding