Re: incorrect pg_dump output due to not handling dropped rolescorrectly - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: incorrect pg_dump output due to not handling dropped rolescorrectly
Date
Msg-id 20191118031059.GA1543@paquier.xyz
Whole thread Raw
In response to Re: incorrect pg_dump output due to not handling dropped rolescorrectly  (Floris Van Nee <florisvannee@Optiver.com>)
Responses Re: incorrect pg_dump output due to not handling dropped rolescorrectly  (Michael Paquier <michael@paquier.xyz>)
List pgsql-bugs
On Sun, Nov 17, 2019 at 08:56:13PM +0000, Floris Van Nee wrote:
> As for the proper fix, indeed it looks like the 'drop role' needs to
> be taught to update pg_init_privs.

The dependencies related to the ACL entries exist in pg_shdepend
between the role and the revoked objects, and these get removed when
issuing DROP OWNED BY.  So it seems to me that the cleanup needs to
happen when issuing the DROP OWNED BY query, and not DROP ROLE.
Looking at the code, it seems to me that we should just patch
shdepDropOwned() to handle properly the removal of the role in ACL
objects in pg_init_privs for all the objects we are removing a
dependency on.  I am just diving into a patch..
--
Michael

Attachment

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #16122: segfault pg_detoast_datum (datum=0x0) at fmgr.c:1833 numrange query
Next
From: Michael Paquier
Date:
Subject: Re: incorrect pg_dump output due to not handling dropped rolescorrectly