Re: incorrect pg_dump output due to not handling dropped roles correctly

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Floris Van Nee <florisvannee(at)Optiver(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>, Ferdi Smit <FerdiSmit(at)Optiver(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>
Subject: Re: incorrect pg_dump output due to not handling dropped roles correctly
Date: 2019-11-18 03:10:59
Message-ID: 20191118031059.GA1543@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2019-11-18 04:14:33 Re: incorrect pg_dump output due to not handling dropped roles correctly
Previous Message PG Bug reporting form 2019-11-18 01:27:22 BUG #16122: segfault pg_detoast_datum (datum=0x0) at fmgr.c:1833 numrange query