]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix pg_dump for GRANT OPTION among initial privileges.
authorNoah Misch <noah@leadboat.com>
Sat, 16 Jan 2021 20:21:35 +0000 (12:21 -0800)
committerNoah Misch <noah@leadboat.com>
Sat, 16 Jan 2021 20:21:39 +0000 (12:21 -0800)
commita0d31b1c94143c12c98da85652aeb5ff240489c7
tree07ba7ad1b8f9d5c3b8c69b7f1994c2e0f3101052
parent66087f7e922c7279ee2c1967760de0c1f942522b
Fix pg_dump for GRANT OPTION among initial privileges.

The context is an object that no longer bears some aclitem that it bore
initially.  (A user issued REVOKE or GRANT statements upon the object.)
pg_dump is forming SQL to reproduce the object ACL.  Since initdb
creates no ACL bearing GRANT OPTION, reaching this bug requires an
extension where the creation script establishes such an ACL.  No PGXN
extension does that.  If an installation did reach the bug, pg_dump
would have omitted a semicolon, causing a REVOKE and the next SQL
statement to fail.  Separately, since the affected code exists to
eliminate an entire aclitem, it wants plain REVOKE, not REVOKE GRANT
OPTION FOR.  Back-patch to 9.6, where commit
23f34fa4ba358671adab16773e79c17c92cbc870 first appeared.

Discussion: https://postgr.es/m/20210109102423.GA160022@rfd.leadboat.com
src/bin/pg_dump/dumputils.c
src/test/modules/test_pg_dump/t/001_base.pl
src/test/modules/test_pg_dump/test_pg_dump--1.0.sql