Re: pg_createsubscriber does not check output_plugin_libraries

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, "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-15 05:56:17
Message-ID: 548B1C2F-8368-465D-8309-930A7EE58A90@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Sep 9, 2026, at 18:33, Hayato Kuroda (Fujitsu) <kuroda(dot)hayato(at)fujitsu(dot)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/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2026-09-15 06:42:55 property graph and pg_dump
Previous Message Chao Li 2026-09-15 05:47:49 Re: pg_createsubscriber does not check output_plugin_libraries