postgresql/src/bin/pg_dump
Tom Lane db820b9a9d Avoid trying to restore table ACLs and per-column ACLs in parallel.
Parallel pg_restore has always supposed that ACL items for different
objects are independent and can be restored in parallel without
conflicts.  However, there is one case where this fails: because
REVOKE on a table is defined to also revoke the privilege(s) at
column level, we can't restore per-column ACLs till after we restore
any table-level privileges on their table.  Failure to honor this
restriction can lead to "tuple concurrently updated" errors during
parallel restore, or even to the per-column ACLs silently disappearing
because the table-level REVOKE is executed afterwards.

To fix, add a dependency from each column-level ACL item to its table's
ACL item, if there is one.  Note that this doesn't fix the hazard
for pre-existing archive files, only for ones made with a corrected
pg_dump.  Given that the bug's been there quite awhile without
field reports, I think this is acceptable.

This requires changing the API of pg_dump's dumpACL() function.
To keep its argument list from getting even longer, I removed the
"CatalogId objCatId" argument, which has been unused for ages.

Per report from Justin Pryzby.  Back-patch to all supported branches.

Discussion: https://postgr.es/m/20200706050129.GW4107@telsasoft.com
2020-07-11 13:36:51 -04:00
..
po Translation updates 2020-05-11 13:31:50 +02:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
common.c Avoid trying to restore table ACLs and per-column ACLs in parallel. 2020-07-11 13:36:51 -04:00
compress_io.c Fix pg_dump's errno checking for zlib I/O 2017-08-02 18:26:58 -04:00
compress_io.h Fix pg_dump's errno checking for zlib I/O 2017-08-02 18:26:58 -04:00
dumputils.c Further fixes for quoted-list GUC values in pg_dump and ruleutils.c. 2018-07-31 13:00:08 -04:00
dumputils.h Further fixes for quoted-list GUC values in pg_dump and ruleutils.c. 2018-07-31 13:00:08 -04:00
keywords.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
Makefile Update copyright for 2015 2015-01-06 11:43:47 -05:00
nls.mk Translation updates 2016-02-08 14:21:00 -05:00
parallel.c Fix parallel pg_dump/pg_restore for failure to create worker processes. 2020-01-31 14:41:49 -05:00
parallel.h Fix parallel pg_dump/pg_restore for failure to create worker processes. 2020-01-31 14:41:49 -05:00
pg_backup.h Avoid trying to restore table ACLs and per-column ACLs in parallel. 2020-07-11 13:36:51 -04:00
pg_backup_archiver.c Fix pg_dump/pg_restore to restore event trigger comments later. 2020-04-08 11:23:40 -04:00
pg_backup_archiver.h Fix pg_dump/pg_restore to restore event triggers later. 2020-03-09 14:58:11 -04:00
pg_backup_custom.c Fix typos in comments. 2017-02-06 11:34:18 +02:00
pg_backup_db.c Empty search_path in Autovacuum and non-psql/pgbench clients. 2018-02-26 07:39:48 -08:00
pg_backup_db.h Make pg_dump error cleanly with -j against hot standby 2016-05-26 22:18:04 +02:00
pg_backup_directory.c Ensure write failure reports no-disk-space 2020-06-19 16:46:06 -04:00
pg_backup_null.c Access pg_dump's options structs through Archive struct, not directly. 2016-01-13 17:48:33 -05:00
pg_backup_tar.c Fix build on zlib-less environments 2017-08-03 14:55:17 -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 Clean up thread management in parallel pg_dump for Windows. 2016-05-27 12:02:09 -04:00
pg_backup_utils.h Tweak __attribute__-wrapping macros for better pgindent results. 2015-03-26 14:03:25 -04:00
pg_dump.c Avoid trying to restore table ACLs and per-column ACLs in parallel. 2020-07-11 13:36:51 -04:00
pg_dump.h Fix pg_dump's handling of circular dependencies in views. 2019-10-26 17:37:19 -04:00
pg_dump_sort.c Fix pg_dump/pg_restore to restore event triggers later. 2020-03-09 14:58:11 -04:00
pg_dumpall.c Further fixes for quoted-list GUC values in pg_dump and ruleutils.c. 2018-07-31 13:00:08 -04:00
pg_restore.c Change pg_restore -f- to dump to stdout instead of to ./- 2019-11-05 09:57:36 -03:00