pgsql: Add functions pg_restore_relation_stats(), pg_restore_attribute_ - Mailing list pgsql-committers

From Jeff Davis
Subject pgsql: Add functions pg_restore_relation_stats(), pg_restore_attribute_
Date
Msg-id E1t43Cq-002GpH-Tb@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d32d1463995c036853eeb9ec99cc367ffc7794ae

Modified Files
--------------
doc/src/sgml/func.sgml                     | 100 +++
src/backend/statistics/attribute_stats.c   |  19 +
src/backend/statistics/relation_stats.c    |  60 +-
src/backend/statistics/stat_utils.c        | 126 ++++
src/include/catalog/catversion.h           |   2 +-
src/include/catalog/pg_proc.dat            |  20 +-
src/include/statistics/stat_utils.h        |   5 +
src/test/regress/expected/stats_import.out | 955 +++++++++++++++++++++++++++--
src/test/regress/sql/stats_import.sql      | 696 ++++++++++++++++++++-
9 files changed, 1891 insertions(+), 92 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Generalize plpgsql's heuristic for importing expanded objects.
Next
From: Richard Guo
Date:
Subject: pgsql: Remove the RTE_GROUP RTE if we drop the groupClause