pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add support for "dependencies" in pg_restore_extended_stats()
Date: Mon, 26 Jan 2026 23:21:11 +0000
Message-ID: <E1vkVtO-002r8r-1a@gemulon.postgresql.org> (raw)

Add support for "dependencies" in pg_restore_extended_stats()

This commit adds support for the restore of extended statistics of the
kind "dependencies", for the following input data:
[{"attributes": [2], "dependency": 3, "degree": 1.000000},
 {"attributes": [3], "dependency": 2, "degree": 1.000000}]

This relies on the existing routines of "dependencies" to cross-check
the input data with the definition of the extended statistics objects
for the attribute numbers.  An input argument of type "pg_dependencies"
is required for this new option.

Thanks to the work done in 0e80f3f88dea for the restore function and
e1405aa5e3ac for the input handling of data type pg_dependencies, this
addition is straight-forward.  This will be used so as it is possible to
transfer these statistics across dumps and upgrades, removing the need
for a post-operation ANALYZE for these kinds of statistics.

Author: Corey Huinker <corey.huinker@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/CADkLM=dpz3KFnqP-dgJ-zvRvtjsa8UZv8wDAQdqho=qN3kX0Zg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/302879bd68d1156fa27c38d29763ca9e4a1649c4

Modified Files
--------------
doc/src/sgml/func/func-admin.sgml             |  8 ++---
src/backend/statistics/extended_stats_funcs.c | 38 ++++++++++++++++++++++
src/test/regress/expected/stats_import.out    | 45 +++++++++++++++++++++++++++
src/test/regress/sql/stats_import.sql         | 29 +++++++++++++++++
4 files changed, 116 insertions(+), 4 deletions(-)



Message-ID: <E1vkVtO-002r8r-1a@gemulon.postgresql.org>
Permalink:  ../E1vkVtO-002r8r-1a@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vkVtO-002r8r-1a@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add support for "dependencies" in pg_restore_extended_stats()
  In-Reply-To: <E1vkVtO-002r8r-1a@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox