Re: pg_dump needs SELECT privileges on irrelevant extension table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Jacob Champion <champion(dot)p(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Akshat Jaimini <destrex271(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_dump needs SELECT privileges on irrelevant extension table
Date: 2023-10-18 20:25:39
Message-ID: 3152156.1697660739@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Stephen Frost <sfrost(at)snowman(dot)net> writes:
> Greetings,
> * Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
>> I wrote:
>>> Why are we marking extension member objects as being subject to SECLABEL
>>> or POLICY dumping?

> This change would mean that policies added by a user after the extension
> is created would just be lost by a pg_dump/reload, doesn't it?

Yes. But I'd say that's unsupported, just like making other ad-hoc
changes to extension objects is unsupported (and the effects will be
lost on dump/reload). We specifically have support for user-added
ACLs, and that's good, but don't claim that we have support for
doing the same with policies.

As far as I can see, the current behavior is that we'll dump and
try to reload policies (and seclabels) on extension objects even
if those properties were set by the extension creation script.
That has many more problems than just the one Jacob is moaning
about: you'll see failures at reload if you're not superuser,
and if the destination installation has a newer version of the
extension than what was dumped, the old properties might be
completely inappropriate. So IMO there's basically nothing
that works properly about this. To make it work, we'd need
infrastructure comparable to the pg_init_privs infrastructure.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2023-10-18 21:16:10 Re: Variable substitution in jsonb functions fails for jsonpath operator like_regex
Previous Message Laurenz Albe 2023-10-18 20:17:58 Re: BUG #18160: first create table show "ERROR: permission denied for schema public", next create table works

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-10-18 20:45:46 Re: Add support for AT LOCAL
Previous Message Stephen Frost 2023-10-18 20:11:59 Re: pg_dump needs SELECT privileges on irrelevant extension table