postgresql/src/bin/pg_dump
Tom Lane 1e0841426e In pg_dump, don't dump a stats object unless dumping underlying table.
If the underlying table isn't being dumped, it's useless to dump
an extended statistics object; it'll just cause errors at restore.
We have always applied similar policies to, say, indexes.

(When and if we get cross-table stats objects, it might be profitable
to think a little harder about what to do with them.  But for now
there seems no point in considering a stats object as anything but
an appendage of its table.)

Rian McGuire and Tom Lane, per report from Rian McGuire.
Back-patch to supported branches.

Discussion: https://postgr.es/m/7075d3aa-3f05-44a5-b68f-47dc6a8a0550@buildkite.com
2023-12-29 10:57:11 -05:00
..
po Translation updates 2023-11-06 13:16:22 +01:00
t In pg_dump, don't dump a stats object unless dumping underlying table. 2023-12-29 10:57:11 -05: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 Improve frontend error logging style. 2022-04-08 14:55:14 -04:00
compress_io.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
dumputils.c Allow granting SET and ALTER SYSTEM privileges on GUC parameters. 2022-04-06 13:24:33 -04:00
dumputils.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
Makefile pg_dump: Dump colliculocale 2022-08-24 20:16:12 +02:00
nls.mk Translation updates 2022-11-07 14:04:05 +01:00
parallel.c Improve frontend error logging style. 2022-04-08 14:55:14 -04:00
parallel.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_backup.h Add support for --no-table-access-method in pg_{dump,dumpall,restore} 2022-01-17 14:51:46 +09: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 Improve frontend error logging style. 2022-04-08 14:55:14 -04:00
pg_backup_custom.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
pg_backup_db.c Improve frontend error logging style. 2022-04-08 14:55:14 -04: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 Improve frontend error logging style. 2022-04-08 14:55:14 -04:00
pg_backup_null.c Improve frontend error logging style. 2022-04-08 14:55:14 -04:00
pg_backup_tar.c Improve frontend error logging style. 2022-04-08 14:55:14 -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 Improve frontend error logging style. 2022-04-08 14:55:14 -04:00
pg_backup_utils.h Remove not-very-useful early checks of __pg_log_level in logging.h. 2022-04-12 13:25:29 -04:00
pg_dump.c In pg_dump, don't dump a stats object unless dumping underlying table. 2023-12-29 10:57:11 -05:00
pg_dump.h In pg_dump, don't dump a stats object unless dumping underlying table. 2023-12-29 10:57:11 -05:00
pg_dump_sort.c Fix pg_dump's failure to honor dependencies of SQL functions. 2023-06-04 13:05:54 -04:00
pg_dumpall.c Handle DROP DATABASE getting interrupted 2023-07-13 13:04:45 -07:00
pg_restore.c Improve frontend error logging style. 2022-04-08 14:55:14 -04:00