Matview statistics depend on matview data.

Jeff Davis <jdavis@postgresql.org>

Commit: a0a4601765b896079eb82a9d5cfa1f41154fcfdb
Author: Jeff Davis <jdavis@postgresql.org>
Date: 2025-03-28T23:12:55Z
Releases: 18.0
Matview statistics depend on matview data.

REFRESH MATERIALIZED VIEW replaces the storage, which resets
statistics, so statistics must be restored afterward.

If both statistics and data are being dumped for a materialized view,
add a dependency from the former to the latter. Defer the statistics
to SECTION_POST_DATA, and use RESTORE_PASS_POST_ACL.

Reported-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Discussion: https://postgr.es/m/CAExHW5s47kmubpbbRJzSM-Zfe0Tj2O3GBagB7YAyE8rQ-V24Uw@mail.gmail.com

Files

PathChange+/−
src/bin/pg_dump/pg_backup_archiver.c modified +34 −12
src/bin/pg_dump/pg_dump.c modified +54 −46
src/bin/pg_dump/pg_dump.h modified +2 −1
src/bin/pg_dump/pg_dump_sort.c modified +1 −1

Discussion