public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: Ewan Young <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: Corey Huinker <[email protected]>
Subject: Re: Reject ill-formed range bounds histograms in pg_restore_attribute_stats()
Date: Wed, 8 Jul 2026 11:17:06 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAON2xHNM809WLR_g0ymKgU-tWxtbyH1Xvh4fqzRqy9YP2A59pg@mail.gmail.com>
References: <CAON2xHNM809WLR_g0ymKgU-tWxtbyH1Xvh4fqzRqy9YP2A59pg@mail.gmail.com>

On Tue, Jul 07, 2026 at 04:13:30PM +0800, Ewan Young wrote:
> The attached patch validates the bounds histogram at import time and
> rejects an ill-formed one with a WARNING, matching the treatment of the
> other inconsistent inputs.  Because the histogram element type is a range
> for both range- and multirange-typed columns, the single check covers
> both.

I have been looking at that, and while the consequences of buggy
inputs are minor when loaded back, I don't really mind putting more
defenses to inform about that at the front of the restore functions.

Now, your patch is entirely blind about extended statistics; these can
also load histogram bounds.  The function you are introducing to
filter the inputs provided could be reused in this secondary case,
just by moving to stat_utils.c.

I am not really convinced that any of this stuff would be worth a
backpatch, even if it's non-invasive.  We don't have guards for
buggy infinite values, even if using empty or unordered bounds feels
kind of a stupid thing to do if one is a table owner.
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../[email protected]/2-signature.asc)
  download

view thread (5+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Reject ill-formed range bounds histograms in pg_restore_attribute_stats()
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox