postgresql/src/bin
Stephen Frost eb5e9d90df pg_dump: Fix handling of ALTER DEFAULT PRIVILEGES
In commit 23f34fa, we changed how ACLs were handled to use the new
pg_init_privs catalog and to dump out the ACL commands as REVOKE+GRANT
combinations instead of trying to REVOKE all rights always and then
GRANT back just the ones which were in place.

Unfortunately, the DEFAULT PRIVILEGES system didn't quite get the
correct treatment with this change and ended up (incorrectly) only
including positive GRANTs instead of both the REVOKEs and GRANTs
necessary to preserve the correct privileges.

There are only a couple cases where such REVOKEs are possible because,
generally speaking, there's few rights which exist on objects by
default to be revoked.

Examples of REVOKEs which weren't being correctly preserved are when
privileges are REVOKE'd from the creator/owner, like so:

ALTER DEFAULT PRIVILEGES
  FOR ROLE myrole
  REVOKE SELECT ON TABLES FROM myrole;

or when other default privileges are being revoked, such as EXECUTE
rights granted to public for functions:

ALTER DEFAULT PRIVILEGES
  FOR ROLE myrole
  REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC;

Fix this by correctly working out what the correct REVOKE statements are
(if any) and dump them out, just as we do for everything else.

Noticed while developing additional regression tests for pg_dump, which
will be landing shortly.

Back-patch to 9.6 where the bug was introduced.
2017-01-31 16:24:14 -05:00
..
initdb Bring some clarity to the defaults for the xxx_flush_after parameters. 2016-11-25 18:36:10 -05:00
pg_archivecleanup pgindent run for 9.6 2016-06-09 18:02:36 -04:00
pg_basebackup Change qr/foo$/m to qr/foo\n/m, for Perl 5.8.8. 2016-11-07 20:27:35 -05:00
pg_config Translation updates 2016-10-24 11:15:25 -04:00
pg_controldata Translation updates 2016-10-24 11:15:25 -04:00
pg_ctl Translation updates 2016-10-24 11:15:25 -04:00
pg_dump pg_dump: Fix handling of ALTER DEFAULT PRIVILEGES 2017-01-31 16:24:14 -05:00
pg_resetxlog Translation updates 2016-10-24 11:15:25 -04:00
pg_rewind pg_rewing pg_upgrade: Fix translation markers 2016-11-07 09:53:55 -05:00
pg_test_fsync Move pg_test_fsync from contrib/ to src/bin/ 2015-04-19 22:20:49 -04:00
pg_test_timing Move pg_test_timing from contrib/ to src/bin/ 2015-04-20 21:30:12 -04:00
pg_upgrade pg_upgrade: Fix for changed pg_ctl default stop mode 2017-01-13 16:19:48 -05:00
pg_xlogdump pg_xlogdump: document --path behavior 2017-01-10 22:38:13 -05:00
pgbench Print test parameters like "foo: 123", and results like "foo = 123". 2016-09-21 13:24:42 +03:00
pgevent Update copyright for 2016 2016-01-02 13:33:40 -05:00
psql Fix incorrect error reporting for duplicate data in \crosstabview. 2016-12-25 16:04:47 -05:00
scripts Translation updates 2016-10-24 11:15:25 -04:00
Makefile Update copyright for 2016 2016-01-02 13:33:40 -05:00