Re: BUG #19842: pg_restore_extended_stats() rejects a faithful pg_dump of ANALYZE-produced range expression statisti

From: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: 303677365(at)qq(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19842: pg_restore_extended_stats() rejects a faithful pg_dump of ANALYZE-produced range expression statisti
Date: 2026-11-12 21:07:54
Message-ID: CADkLM=fBn3KkGu1H0oEnUxiUydVtwk5jhdeqbX0DkgfZAV0ejQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Nov 11, 2026 at 8:34 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:

> On Tue, Nov 10, 2026 at 08:54:33PM -0500, Corey Huinker wrote:
> > 0003 - The extended stats equivalent of 0001
>
> Corey, could you rebase this one on HEAD, or reshape it according to
> 2656f664616d? That would help..
> --
> Michael
>

The v1 0001 patch is now gone as, that was replaced by 2656f664616d.

0001 -

Decoupling range_bounds_histogram. No changes since last patchset where it
was number 0002.

0002 -

Fix to pg_dump to handle NULL values in range_length_histogram and
most_common_elems when their corresponding stanumbers field is not null.

I was able to test this against 18, however I [1] was not able to
synthesize data such that an extended statistics object on 18 that had
expression stats with a NULL most_common_elems and NOT NULL
most_common_elem_freqs. I asked Claude to try to do it as well, and it too
was not able to.

0003 -

This has the same goals as the original 0003, but using the methods laid
out in 2656f664616d.

Attachment Content-Type Size
v19842.2-0001-Decouple-range_bounds_histogram-requirement.patch text/x-patch 9.0 KB
v19842.2-0002-pg_dump-Map-mismatched-NULL-values-arrays-t.patch text/x-patch 4.4 KB
v19842.2-0003-Allow-empty-arrays-of-values-in-pg_restore_.patch text/x-patch 9.2 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Zsolt Parragi 2026-11-12 21:19:08 Re: Timing issue in pg_basebackup
Previous Message Andrey Rachitskiy 2026-11-12 20:19:19 Re: BUG #19883: Partition pruning errors on SubPlan inside = ANY array