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

Attachment: signature.asc
Description: PGP signature

Reply via email to