From: Tom Lane <tgl@sss.pgh.pa.us>
To: Noah Misch <noah@leadboat.com>
Cc: pgsql-hackers@lists.postgresql.org, Daniel Gustafsson <daniel@yesql.se>
Cc: Stephen Frost <sfrost@snowman.net>
Subject: Re: DROP OWNED BY fails to clean out pg_init_privs grants
Date: Fri, 05 Apr 2024 22:10:06 -0400
Message-ID: <1772963.1712369406@sss.pgh.pa.us> (raw)
In-Reply-To: <20240406014625.52.nmisch@google.com>
References: <1745535.1712358659@sss.pgh.pa.us>
<20240406014625.52.nmisch@google.com>
Noah Misch <noah@leadboat.com> writes:
> On Fri, Apr 05, 2024 at 07:10:59PM -0400, Tom Lane wrote:
>> The fact that the DROP ROLE added by 936e3fa37 succeeded indicates
>> that these role references weren't captured in pg_shdepend.
>> I imagine that we also lack code that would allow DROP OWNED BY to
>> follow up on such entries if they existed, but I've not checked that
>> for sure. In any case, there's probably a nontrivial amount of code
>> to be written to make this work.
>>
>> Given the lack of field complaints, I suspect that extension scripts
>> simply don't grant privileges to random roles that aren't the
>> extension's owner. So I wonder a little bit if this is even worth
>> fixing, as opposed to blocking off somehow. But probably we should
>> first try to fix it.
> This sounds closely-related to the following thread:
> https://www.postgresql.org/message-id/flat/1573808483712.96817%40Optiver.com
Oh, interesting, I'd forgotten that thread completely.
So Stephen was pushing back against dealing with the case because
he thought that the SQL commands issued in that example should not
have produced pg_init_privs entries in the first place. Which nobody
else wanted to opine on, so the thread stalled. However, in the case
of the test_pg_dump extension, the test_pg_dump--1.0.sql script
absolutely did grant those privileges so it's very hard for me to
think that they shouldn't be listed in pg_init_privs. Hence, I think
we've accidentally stumbled across a case where we do need all that
mechanism --- unless somebody wants to argue that what
test_pg_dump--1.0.sql is doing should be disallowed.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, noah@leadboat.com, daniel@yesql.se, sfrost@snowman.net
Subject: Re: DROP OWNED BY fails to clean out pg_init_privs grants
In-Reply-To: <1772963.1712369406@sss.pgh.pa.us>
References: <1745535.1712358659@sss.pgh.pa.us> <20240406014625.52.nmisch@google.com> <1772963.1712369406@sss.pgh.pa.us>
* 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