postgresql/src/bin/pg_dump
Tom Lane 891afa84c2 Don't try to dump RLS policies or security labels for extension objects.
checkExtensionMembership() set the DUMP_COMPONENT_SECLABEL and
DUMP_COMPONENT_POLICY flags for extension member objects, even though
we lack any infrastructure for tracking extensions' initial settings
of these properties.  This is not OK.  The result was that a dump
would always include commands to set these properties for extension
objects that have them, with at least three negative consequences:

1. The restoring user might not have privilege to set these properties
on these objects.

2. The properties might be incorrect/irrelevant for the version of the
extension that's installed in the destination database.

3. The dump itself might fail, in the case of RLS properties attached
to extension tables that the dumping user lacks privilege to LOCK.
(That's because we must get at least AccessShareLock to ensure that
we don't fail while trying to decompile the RLS expressions.)

When and if somebody cares to invent initial-state infrastructure for
extensions' RLS policies and security labels, we could think about
finding another way around problem #3.  But in the absence of such
infrastructure, this whole thing is just wrong and we shouldn't do it.

(Note: this applies only to ordinary dumps; binary-upgrade dumps
still dump and restore extension member objects separately, with
all properties.)

Tom Lane and Jacob Champion.  Back-patch to all supported branches.

Discussion: https://postgr.es/m/00d46a48-3324-d9a0-49bf-e7f0f11d1038@timescale.com
2023-11-13 17:04:10 -05:00
..
po Translation updates 2023-11-06 13:27:02 +01:00
t Fix omission of column-level privileges in selective pg_restore. 2023-10-02 13:27:51 -04:00
.gitignore Clean up after pg_dump test runs. 2016-05-06 22:28:01 -04:00
common.c Fix pg_dump for hash partitioning on enum columns. 2023-03-17 13:31:40 -04:00
compress_io.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
compress_io.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
dumputils.c Fix pg_dump for GRANT OPTION among initial privileges. 2021-01-16 12:21:39 -08:00
dumputils.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
Makefile Add missing dependency of pg_dumpall to WIN32RES. 2022-03-22 08:28:53 -07:00
nls.mk Translation updates 2020-05-11 13:19:18 +02:00
parallel.c In libpq for Windows, call WSAStartup once and WSACleanup not at all. 2020-10-19 11:23:51 -04:00
parallel.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
pg_backup.h Revert "pg_dump: Lock all relations, not just plain tables". 2020-11-06 15:48:21 -05:00
pg_backup_archiver.c Fix omission of column-level privileges in selective pg_restore. 2023-10-02 13:27:51 -04:00
pg_backup_archiver.h Fix pg_restore's misdesigned code for detecting archive file format. 2021-04-01 13:34:16 -04:00
pg_backup_custom.c Cope with data-offset-less archive files during out-of-order restores. 2020-07-17 13:03:50 -04:00
pg_backup_db.c Revert "pg_dump: Lock all relations, not just plain tables". 2020-11-06 15:48:21 -05:00
pg_backup_db.h Revert "pg_dump: Lock all relations, not just plain tables". 2020-11-06 15:48:21 -05:00
pg_backup_directory.c Handle close() failures more robustly in pg_dump and pg_basebackup. 2021-11-17 13:08:25 -05:00
pg_backup_null.c Fix typos. 2019-05-24 12:00:59 +12:00
pg_backup_tar.c Handle close() failures more robustly in pg_dump and pg_basebackup. 2021-11-17 13:08:25 -05: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 Unified logging system for command-line programs 2019-04-01 20:01:35 +02:00
pg_backup_utils.h Move logging.h and logging.c from src/fe_utils/ to src/common/. 2019-05-14 14:20:10 -04:00
pg_dump.c Don't try to dump RLS policies or security labels for extension objects. 2023-11-13 17:04:10 -05:00
pg_dump.h Fix pg_dump for hash partitioning on enum columns. 2023-03-17 13:31:40 -04:00
pg_dump_sort.c Adjust pg_dump's priority ordering for casts. 2021-11-22 17:16:29 -05:00
pg_dumpall.c Handle DROP DATABASE getting interrupted 2023-07-13 13:03:36 -07:00
pg_restore.c Fix handling of -d "connection string" in pg_dump/pg_restore. 2020-09-24 18:19:38 -04:00