[PATCH] pg_dump: Do not dump statistics for excluded tables
Rian McGuire <rian.mcguire@buildkite.com>
From: Rian McGuire <rian.mcguire@buildkite.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2023-12-27T04:44:09Z
Lists: pgsql-hackers
Attachments
- v1-0001-pg_dump-Do-not-dump-statistics-for-excluded-tables.patch (text/plain) patch v1-0001
Hi hackers, I've attached a patch against master that addresses a small bug in pg_dump. Previously, pg_dump would include CREATE STATISTICS statements for tables that were excluded from the dump, causing reload to fail if any excluded tables had extended statistics. The patch skips the creation of the StatsExtInfo if the associated table does not have the DUMP_COMPONENT_DEFINITION flag set. This is similar to how getPublicationTables behaves if a table is excluded. I've covered this with a regression test by altering one of the CREATE STATISTICS examples to work with the existing 'exclude_test_table' run. Without the fix, that causes the test to fail with: # Failed test 'exclude_test_table: should not dump CREATE STATISTICS extended_stats_no_options' # at t/002_pg_dump.pl line 4934. Regards, Rian
Commits
-
In pg_dump, don't dump a stats object unless dumping underlying table.
- b2c9936a7156 16.2 landed
- aa2e323eedc9 14.11 landed
- 8d4e8b746815 13.14 landed
- 7418767f11d1 17.0 landed
- 69d7edb06fc6 12.18 landed
- 1e0841426e96 15.6 landed