From: Michael Paquier <michael@paquier.xyz>
To: Masahiko Sawada <masahiko.sawada@2ndquadrant.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: Martín Marqués <martin@2ndquadrant.com>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Read access for pg_monitor to pg_replication_origin_status view
Date: Tue, 9 Jun 2020 16:35:55 +0900
Message-ID: <20200609073555.GF38342@paquier.xyz> (raw)
In-Reply-To: <CA+fd4k68H8bPCyq7RggEjyvvag47gG61-wXQm_sSOzvovP+Fhg@mail.gmail.com>
References: <20200604.161033.1845732016784727041.horikyota.ntt@gmail.com>
<CAPdiE1wUt3WQZq30Wa1Xz0NM7rtVPZdK15PKRd0zS3ugZsCsow@mail.gmail.com>
<CA+fd4k6ybp7M=GXKrJG0h4eg9XehmtGtKBxwwA9auHUuTNk+Kg@mail.gmail.com>
<20200608.174456.238992210909952383.horikyota.ntt@gmail.com>
<20200609061104.GD38342@paquier.xyz>
<CA+fd4k68H8bPCyq7RggEjyvvag47gG61-wXQm_sSOzvovP+Fhg@mail.gmail.com>
On Tue, Jun 09, 2020 at 03:32:24PM +0900, Masahiko Sawada wrote:
> One thing I'm concerned with this change is that we will end up
> needing to grant both execute on pg_show_replication_origin_status()
> and select on pg_replication_origin_status view when we want a
> non-super user to access pg_replication_origin_status. It’s unlikely
> that the user can grant both privileges at once as
> pg_show_replication_origin_status() is not documented.
Not sure if that's worth worrying. We have similar cases like that,
take for example pg_file_settings with pg_show_all_file_settings()
which requires both a SELECT ACL on pg_file_settings and an EXECUTE
ACL on pg_show_all_file_settings(). My point is that if you issue a
GRANT SELECT on the catalog view, the user can immediately see when
trying to query it that an extra execution is needed.
> A user having a replication privilege already is able to execute these
> functions. Do you mean to ease it so that a user also executes them
> without replication privilege?
Arf. Please forget what I wrote here, the hardcoded check for
replication rights would be a problem.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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: michael@paquier.xyz, masahiko.sawada@2ndquadrant.com, horikyota.ntt@gmail.com, martin@2ndquadrant.com, sfrost@snowman.net
Subject: Re: Read access for pg_monitor to pg_replication_origin_status view
In-Reply-To: <20200609073555.GF38342@paquier.xyz>
* 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