postgresql/src/bin/pg_dump
Tom Lane a70f2a57f2 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:26 -05:00
..
po Translation updates 2023-08-07 12:39:30 +02:00
t Clean up some pg_dump tests 2023-10-18 08:08:17 +02:00
.gitignore Clean up after pg_dump test runs. 2016-05-06 22:28:01 -04:00
common.c Catalog not-null constraints 2023-08-25 13:31:24 +02:00
compress_gzip.c pg_dump: Fix gzip compression of empty data 2023-03-29 02:34:48 +02:00
compress_gzip.h Introduce a generic pg_dump compression API 2023-02-23 18:33:40 +01:00
compress_io.c Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
compress_io.h Advance input pointer when LZ4 compressing data 2023-05-17 16:49:34 +02:00
compress_lz4.c Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
compress_lz4.h Add LZ4 compression to pg_dump 2023-02-23 21:19:26 +01:00
compress_none.c Unify buffer sizes in pg_dump compression API 2023-03-23 17:55:52 +01:00
compress_none.h Introduce a generic pg_dump compression API 2023-02-23 18:33:40 +01:00
compress_zstd.c Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
compress_zstd.h Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
dumputils.c Revert MAINTAIN privilege and pg_maintain predefined role. 2023-07-07 11:25:13 -07:00
dumputils.h Revert "Add USER SET parameter values for pg_db_role_setting" 2023-05-17 20:28:57 +03:00
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
meson.build pg_dump: Add support for zstd compression 2023-04-05 21:39:33 +02:00
nls.mk Add missing source file to nls.mk 2023-05-08 08:24:42 +02:00
parallel.c Add trailing commas to enum definitions 2023-10-26 09:20:54 +02:00
parallel.h Add trailing commas to enum definitions 2023-10-26 09:20:54 +02:00
pg_backup.h Add trailing commas to enum definitions 2023-10-26 09:20:54 +02:00
pg_backup_archiver.c Fix omission of column-level privileges in selective pg_restore. 2023-10-02 13:27:58 -04:00
pg_backup_archiver.h Add trailing commas to enum definitions 2023-10-26 09:20:54 +02:00
pg_backup_custom.c Introduce a generic pg_dump compression API 2023-02-23 18:33:40 +01:00
pg_backup_db.c pg_dump: Remove "blob" terminology 2022-12-05 08:52:55 +01:00
pg_backup_db.h Revert "pg_dump: Lock all relations, not just plain tables". 2020-11-06 15:48:04 -05:00
pg_backup_directory.c Add support for syncfs() in frontend support functions. 2023-09-06 16:27:00 -07:00
pg_backup_null.c pg_dump: Remove "blob" terminology 2022-12-05 08:52:55 +01:00
pg_backup_tar.c Add and use symbolic constants for tar header offsets and file types. 2023-08-01 13:50:42 -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 Update copyright for 2023 2023-01-02 15:00:37 -05:00
pg_backup_utils.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
pg_dump.c Don't try to dump RLS policies or security labels for extension objects. 2023-11-13 17:04:26 -05:00
pg_dump.h Teach pg_dump about the new pg_subscription.subrunasowner option. 2023-10-29 12:56:35 -04:00
pg_dump_sort.c Remove open-coded binary heap in pg_dump_sort.c. 2023-09-19 19:18:34 -07:00
pg_dumpall.c Fix pg_dumpall with in-place tablespaces 2023-08-09 08:56:05 +09:00
pg_restore.c Improve frontend error logging style. 2022-04-08 14:55:14 -04:00