From: Stephen Frost <sfrost@snowman.net>
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix ordering in pg_dump of GRANTs
Date: Thu, 14 Sep 2017 00:05:43 +0000
Message-ID: <E1dsHf5-0007ZB-Oa@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Fix ordering in pg_dump of GRANTs
The order in which GRANTs are output is important as GRANTs which have
been GRANT'd by individuals via WITH GRANT OPTION GRANTs have to come
after the GRANT which included the WITH GRANT OPTION. This happens
naturally in the backend during normal operation as we only change
existing ACLs in-place, only add new ACLs to the end, and when removing
an ACL we remove any which depend on it also.
Also, adjust the comments in acl.h to make this clear.
Unfortunately, the updates to pg_dump to handle initial privileges
involved pulling apart ACLs and then combining them back together and
could end up putting them back together in an invalid order, leading to
dumps which wouldn't restore.
Fix this by adjusting the queries used by pg_dump to ensure that the
ACLs are rebuilt in the same order in which they were originally.
Back-patch to 9.6 where the changes for initial privileges were done.
Branch
------
REL9_6_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/caae416aac83db7c96695c1927a254e82f7da5dc
Modified Files
--------------
src/bin/pg_dump/dumputils.c | 51 ++++++++++++++++++++++++++++++++-------------
src/include/utils/acl.h | 14 ++++++++++---
2 files changed, 47 insertions(+), 18 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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-committers@postgresql.org
Cc: sfrost@snowman.net
Subject: Re: pgsql: Fix ordering in pg_dump of GRANTs
In-Reply-To: <E1dsHf5-0007ZB-Oa@gemulon.postgresql.org>
References: <E1dsHf5-0007ZB-Oa@gemulon.postgresql.org>
* 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