pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: 125atishprak@gmail.com
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19845: pg_dump extended stats break when column numbers change on restore
Date: Sun, 8 Nov 2026 14:30:34 +0900
Message-ID: <avAI-iyJBMOF27WF@paquier.xyz> (raw)
In-Reply-To: <19845-a2a2ac0ba28b3605@postgresql.org>
References: <19845-a2a2ac0ba28b3605@postgresql.org>

On Sat, Nov 07, 2026 at 02:19:57PM +0000, PG Bug reporting form wrote:
> pg_dump now emits pg_restore_extended_stats() calls, but pg_ndistinct and
> pg_dependencies values, and the column order of MCV lists, are tied to
> attribute
> numbers. A plain dump does not preserve attribute numbers, so the restored
> stats
> can be lost or, worse, silently applied to the wrong columns.

That's a known thing.  Being able to preserve logical order of
attributes across dump-restore is something that has been proposed in
the past, and not something that should be fixed here.  This has been
mentioned previously, and this answer is the same one as I gave
previously.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (3+ messages)

Message-ID: <avAI-iyJBMOF27WF@paquier.xyz>
Permalink:  ../avAI-iyJBMOF27WF@paquier.xyz/
Also on:    postgresql.org/message-id/avAI-iyJBMOF27WF@paquier.xyz

 · 

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-bugs@postgresql.org
  Cc: michael@paquier.xyz, 125atishprak@gmail.com
  Subject: Re: BUG #19845: pg_dump extended stats break when column numbers change on restore
  In-Reply-To: <avAI-iyJBMOF27WF@paquier.xyz>
  References: <19845-a2a2ac0ba28b3605@postgresql.org> <avAI-iyJBMOF27WF@paquier.xyz>

* 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