Re: BUG #19845: pg_dump extended stats break when column numbers change on restore

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: 125atishprak(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19845: pg_dump extended stats break when column numbers change on restore
Date: 2026-11-08 05:30:34
Message-ID: avAI-iyJBMOF27WF@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Ruohang Feng 2026-11-08 15:10:51 Re: BUG #19788: Chinese translation uses incorrect term for “transaction” in “no transaction is in progress”
Previous Message PG Bug reporting form 2026-11-08 04:40:49 BUG #19853: Memoize returns wrong rows when the join operator is hashable but its equality semantics differ from