pgsql: Add functions pg_restore_relation_stats(), pg_restore_attribute_

From: Jeff Davis <jdavis(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add functions pg_restore_relation_stats(), pg_restore_attribute_
Date: 2024-10-24 19:09:12
Message-ID: E1t43Cq-002GpH-Tb@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Richard Guo 2024-10-25 00:53:21 pgsql: Remove the RTE_GROUP RTE if we drop the groupClause
Previous Message Tom Lane 2024-10-24 17:28:36 pgsql: Generalize plpgsql's heuristic for importing expanded objects.