Re: Reject ill-formed range bounds histograms in pg_restore_attribute_stats()

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Ewan Young <kdbase(dot)hack(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
Subject: Re: Reject ill-formed range bounds histograms in pg_restore_attribute_stats()
Date: 2026-07-09 05:28:14
Message-ID: ak8xbvyBwH0uzOU8@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 08, 2026 at 12:16:27PM +0800, Ewan Young wrote:
> Done in v2. I moved the check to stat_utils.c as stats_check_bounds_histogram()
> and now call it from both pg_restore_attribute_stats() and
> pg_restore_extended_stats(). In the extended path I reject an ill-formed
> histogram the same way the sibling stakinds there already do — WARNING plus
> goto pg_statistic_error.

Thanks. I have simplified some of the very-talkative comments,
adjusted one place where array_in_safe() was not mentioned (for
extstats expressions we rely on it for NULLs), tweaked a few more
minor things and applied on HEAD.

> Agreed — v2 targets master only, no back-branch patches.

If somebody has an argument to make here, please feel free.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2026-07-09 05:31:02 Re: PSQL - prevent describe listing tables that are already in listed schemas
Previous Message solai v 2026-07-09 05:03:18 Re: Possible replace of strncpy on xactdesc.c