Re: pg_createsubscriber does not check output_plugin_libraries

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: Ajin Cherian <itsajin(at)gmail(dot)com>, "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 15:17:46
Message-ID: CAHGQGwERPHMz5+KywsHvfU6pgU2pWbRbY7RZOrs82Ok_nPPXoQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 8, 2026 at 7:52 PM Hayato Kuroda (Fujitsu)
<kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
> 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?

Using missing_ok = true seems fine for older minor versions that don't
support output_plugin_libraries, but it doesn't handle insufficient
privileges cases, does it? current_setting('output_plugin_libraries', true)
still raises a permission-denied error if the current user cannot examine
the setting, no?

How about querying pg_settings instead? For example,

SELECT setting
FROM pg_catalog.pg_settings
WHERE name = 'output_plugin_libraries';

This returns no rows if the parameter doesn't exist or the current user
doesn't have permission to examine it, so we could skip the check for
that database in either case.

Regards,

--
Fujii Masao

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Rui Zhao 2026-09-08 15:19:18 Re: [PATCH] Add pg_get_table_ddl() to reconstruct CREATE TABLE statements
Previous Message Dmitry Dolgov 2026-09-08 15:15:12 Re: Add ssl_(supported|shared)_groups to sslinfo