Add functions pg_restore_relation_stats(), pg_restore_attribute_stats().
authorJeff Davis <jdavis@postgresql.org>
Thu, 24 Oct 2024 19:08:00 +0000 (12:08 -0700)
committerJeff Davis <jdavis@postgresql.org>
Thu, 24 Oct 2024 19:08:00 +0000 (12:08 -0700)
commitd32d1463995c036853eeb9ec99cc367ffc7794ae
tree491939500c012087a5dbcd07382ba2f507cbbd26
parent534d0ea6c2b915ac9745d2f070afacd7ba003d28
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
doc/src/sgml/func.sgml
src/backend/statistics/attribute_stats.c
src/backend/statistics/relation_stats.c
src/backend/statistics/stat_utils.c
src/include/catalog/catversion.h
src/include/catalog/pg_proc.dat
src/include/statistics/stat_utils.h
src/test/regress/expected/stats_import.out
src/test/regress/sql/stats_import.sql