Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES
Date
Msg-id 2008944.1634680714@sss.pgh.pa.us
Whole thread Raw
In response to Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES  ("Bossart, Nathan" <bossartn@amazon.com>)
Responses Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
"Bossart, Nathan" <bossartn@amazon.com> writes:
> On 10/19/21, 12:54 PM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
>> I kind of wonder now whether the existing behavior is correct for either
>> case.

> Hm.  If we do this, then this command:
>         ALTER DEFAULT PRIVILEGES FOR ROLE myrole REVOKE ALL ON FUNCTIONS FROM PUBLIC;
> is dumped as:
>         ALTER DEFAULT PRIVILEGES FOR ROLE myrole GRANT ALL ON FUNCTIONS  TO myrole;

[ pokes at it some more... ]  Yeah, I just didn't have my head screwed
on straight.  We need the global entries to be dumped as deltas from
the proper object-type-specific ACL, while the non-global ones should be
dumped as grants only, which can be modeled as a delta from an empty
ACL.  So the patch should be good as given (though maybe the comment
needs more work to clarify this).  Sorry for the noise.

            regards, tom lane



pgsql-bugs by date:

Previous
From: "Bossart, Nathan"
Date:
Subject: Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES
Next
From: "Daniel Verite"
Date:
Subject: Re: BUG #17235: PQsendQuery (with two sql) after PQenterPipelineMode cause ERROR