From: Chao Li <li.evan.chao@gmail.com>
To: Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
Cc: Jacob Champion <jacob.champion@enterprisedb.com>
Cc: Fujii Masao <masao.fujii@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
Subject: Re: pg_createsubscriber does not check output_plugin_libraries
Date: Tue, 15 Sep 2026 13:56:17 +0800
Message-ID: <548B1C2F-8368-465D-8309-930A7EE58A90@gmail.com> (raw)
In-Reply-To: <OS9PR01MB12149E6DB23FD6B53CCC64403F5B02@OS9PR01MB12149.jpnprd01.prod.outlook.com>
References: <OS9PR01MB12149618ED793133C85A61A34F5B52@OS9PR01MB12149.jpnprd01.prod.outlook.com>
<CAOYmi+=AoWyU=MqfsFWUP2QHxsydHG9w2VuNnzswoBZCsCOobg@mail.gmail.com>
<OS9PR01MB12149E6DB23FD6B53CCC64403F5B02@OS9PR01MB12149.jpnprd01.prod.outlook.com>
> On Sep 9, 2026, at 18:33, Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com> wrote:
>
> 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
>
> <v5-PG17-0001-pg_createsubscriber-ensure-output_plugin_lib.txt><v5-PG18-0001-pg_createsubscriber-ensure-output_plugin_lib.txt><v5-PG18-0002-free-allocated-memory-for-max_slot_wal_keep_.txt><v5-0001-pg_createsubscriber-ensure-output_plugin_librarie.patch><v5-0002-free-allocated-memory-for-max_slot_wal_keep_size.patch>
I have nit comment on 0001:
```
+/*
+ * Check per-database settings on the publisher
+ */
+static void
+check_publisher_per_database(const struct LogicalRepInfo *dbinfo)
```
I find the header comment slightly misleading. Although output_plugin_libraries is checked separately for each database connection, its effective value may come from database, role, or connection-level settings. So, maybe rephrase it as: Check effective settings for each publisher database.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: li.evan.chao@gmail.com, kuroda.hayato@fujitsu.com, jacob.champion@enterprisedb.com, masao.fujii@gmail.com, pgsql-hackers@lists.postgresql.org
Subject: Re: pg_createsubscriber does not check output_plugin_libraries
In-Reply-To: <548B1C2F-8368-465D-8309-930A7EE58A90@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox