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: pg_dump: Include column statistics for index-backed constraints
Date: Fri, 02 Oct 2026 08:03:47 +0000
Message-ID: <E1xCYF9-000000026PU-2y8f@gemulon.postgresql.org> (raw)

pg_dump: Include column statistics for index-backed constraints

dumpIndex() emits ALTER INDEX .. SET STATISTICS for per-column
statistics targets, but dumpConstraint() never did.  Targets set on the
expression columns of an exclusion constraint's index were silently
lost on dump/restore and pg_upgrade.

The same code can be used in the index and constraint dump code to
generate these ALTER INDEX commands.  The logic has been refactored so
that both share a new subroutine in charge of generating all these
custom SET STATISTICS, if any.

Oversight in e4fca461ab6f.

Author: Zsolt Parragi <zsolt.parragi@percona.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Andrew Krylosov <krylosov.andrew@gmail.com>
Discussion: https://postgr.es/m/CAN4CZFMd9riOuV5LkM+uV=uF-HYp49C8Fh22xWyMxptGLBCZ3A@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5e158a2e43c2e7fcc1e579f81c2f3645285cba40

Modified Files
--------------
src/bin/pg_dump/pg_dump.c        | 86 ++++++++++++++++++++++------------------
src/bin/pg_dump/t/002_pg_dump.pl | 25 ++++++++++++
2 files changed, 72 insertions(+), 39 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1xCYF9-000000026PU-2y8f@gemulon.postgresql.org>
Permalink:  ../E1xCYF9-000000026PU-2y8f@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xCYF9-000000026PU-2y8f@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: pg_dump: Include column statistics for index-backed constraints
  In-Reply-To: <E1xCYF9-000000026PU-2y8f@gemulon.postgresql.org>
  References: <E1xCYF9-000000026PU-2y8f@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