postgresql/src/bin/pg_dump
Stephen Frost d2e40b310a 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.
2017-09-13 20:02:09 -04:00
..
po Translation updates 2017-08-07 13:55:34 -04:00
t Final pgindent + perltidy run for v10. 2017-08-14 17:29:33 -04:00
.gitignore Clean up after pg_dump test runs. 2016-05-06 22:28:01 -04:00
Makefile Fix broken link-command-line ordering for libpgfeutils. 2017-07-14 12:26:53 -04:00
common.c pg_dump: Add a --load-via-partition-root option. 2017-08-14 22:54:41 -04:00
compress_io.c Final pgindent + perltidy run for v10. 2017-08-14 17:29:33 -04:00
compress_io.h Fix pg_dump's errno checking for zlib I/O 2017-08-02 18:26:59 -04:00
dumputils.c Fix ordering in pg_dump of GRANTs 2017-09-13 20:02:09 -04:00
dumputils.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
nls.mk Translation updates 2017-08-07 13:55:34 -04:00
parallel.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
parallel.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
pg_backup.h pg_dump: Add a --load-via-partition-root option. 2017-08-14 22:54:41 -04:00
pg_backup_archiver.c Reduce excessive dereferencing of function pointers 2017-09-07 13:56:09 -04:00
pg_backup_archiver.h Fix pg_dump/pg_restore to emit REFRESH MATERIALIZED VIEW commands last. 2017-08-03 17:36:39 -04:00
pg_backup_custom.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
pg_backup_db.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
pg_backup_db.h Make pg_dump error cleanly with -j against hot standby 2016-05-26 22:14:23 +02:00
pg_backup_directory.c Fix pg_dump's errno checking for zlib I/O 2017-08-02 18:26:59 -04:00
pg_backup_null.c Reduce excessive dereferencing of function pointers 2017-09-07 13:56:09 -04:00
pg_backup_tar.c Final pgindent + perltidy run for v10. 2017-08-14 17:29:33 -04:00
pg_backup_tar.h Fix tar files emitted by pg_dump and pg_basebackup to be POSIX conformant. 2012-09-28 15:19:15 -04:00
pg_backup_utils.c Reduce excessive dereferencing of function pointers 2017-09-07 13:56:09 -04:00
pg_backup_utils.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
pg_dump.c pg_dump: Support using synchronized snapshots on standbys 2017-08-16 19:46:50 -04:00
pg_dump.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
pg_dump_sort.c Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
pg_dumpall.c pg_dumpall: Add a -E flag to set the encoding, like pg_dump has. 2017-09-01 12:24:20 -04:00
pg_restore.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00