Re: pg_restore_attribute_stats accepts and persists null_frac=NaN

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: ♂π≌26218 <1991230470(at)qq(dot)com>
Cc: pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_restore_attribute_stats accepts and persists null_frac=NaN
Date: 2026-09-11 08:00:08
Message-ID: aqO1CDpx8K55lJs5@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Sep 08, 2026 at 05:53:01PM +0800, ♂π≌26218 wrote:
> The restoration function should reject NaN, Infinity, negative
> values, and values greater than one for null_frac. It should return
> false&nbsp;or raise a controlled error without replacing the
> previous statistic.

Being able to inject stats, even buggy ones, is one reason why this
feature can be attractive in some cases. There are many other ways to
make the planner go crazy on arbitrary data, as far as I know.

Does your example lead to a server crash or an assertion failure? If
the answer to my last question is yes, that may be worth
strenghtening with more control of the input, but in terms of stats
injection, "incorrect" or "unexpected planner behavior" is not worth
bothering about.
--
Michael

In response to

Browse pgsql-bugs by date

  From Date Subject
Previous Message Sylvain PERRAUD 2026-09-11 07:45:47 Re: BUG #19682: Unable to drop a user with default privileges revoked