Add functions pg_restore_relation_stats(), pg_restore_attribute_stats().
Jeff Davis <jdavis@postgresql.org>
Add functions pg_restore_relation_stats(), pg_restore_attribute_stats(). Similar to the pg_set_*_stats() functions, except with a variadic signature that's designed to be more future-proof. Additionally, most problems are reported as WARNINGs rather than ERRORs, allowing most stats to be restored even if some cannot. These functions are intended to be called from pg_dump to avoid the need to run ANALYZE after an upgrade. Author: Corey Huinker Discussion: https://postgr.es/m/CADkLM=eErgzn7ECDpwFcptJKOk9SxZEk5Pot4d94eVTZsvj3gw@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/func.sgml | modified | +100 −0 |
| src/backend/statistics/attribute_stats.c | modified | +19 −0 |
| src/backend/statistics/relation_stats.c | modified | +36 −24 |
| src/backend/statistics/stat_utils.c | modified | +126 −0 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_proc.dat | modified | +19 −1 |
| src/include/statistics/stat_utils.h | modified | +5 −0 |
| src/test/regress/expected/stats_import.out | modified | +916 −39 |
| src/test/regress/sql/stats_import.sql | modified | +669 −27 |
Documentation touched
Discussion
- Statistics Import and Export 555 messages · 2023-08-31 → 2025-05-22