agora inbox for pgsql-bugs@postgresql.org  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: ♂π≌26218 <1991230470@qq.com>
Cc: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Subject: Re: pg_restore_attribute_stats accepts and persists null_frac=NaN
Date: Fri, 11 Sep 2026 17:00:08 +0900
Message-ID: <aqO1CDpx8K55lJs5@paquier.xyz> (raw)
In-Reply-To: <tencent_16A3D0E291B9D54FC48D30FC166410A02806@qq.com>
References: <tencent_16A3D0E291B9D54FC48D30FC166410A02806@qq.com>

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

Attachments:

  [application/pgp-signature] signature.asc (832B, ../aqO1CDpx8K55lJs5@paquier.xyz/2-signature.asc)
  download

view thread (2+ messages)

Message-ID: <aqO1CDpx8K55lJs5@paquier.xyz>
Permalink:  ../aqO1CDpx8K55lJs5@paquier.xyz/
Also on:    postgresql.org/message-id/aqO1CDpx8K55lJs5@paquier.xyz

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: pgsql-bugs@postgresql.org
  Cc: michael@paquier.xyz, 1991230470@qq.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: pg_restore_attribute_stats accepts and persists null_frac=NaN
  In-Reply-To: <aqO1CDpx8K55lJs5@paquier.xyz>

* 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