Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x4wBH-007Vl3-31 for pgsql-bugs@arkaria.postgresql.org; Fri, 11 Sep 2026 08:00:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x4wBG-00D4dG-3D for pgsql-bugs@arkaria.postgresql.org; Fri, 11 Sep 2026 08:00:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x4wBG-00D4d7-2Q for pgsql-bugs@lists.postgresql.org; Fri, 11 Sep 2026 08:00:18 +0000 Received: from fout-b1-smtp.messagingengine.com ([202.12.124.144]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x4wBE-0000000474N-1RlT for pgsql-bugs@lists.postgresql.org; Fri, 11 Sep 2026 08:00:18 +0000 Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfout.stl.internal (Postfix) with ESMTP id 80D4B1D000FD; Fri, 11 Sep 2026 04:00:14 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Fri, 11 Sep 2026 04:00:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1789113614; x=1789200014; bh=1YzKjIGZja NDnO3ThncOHQEq7scrKV+iD8AIgw5y3yA=; b=tJj9BoAiCbM8S3lnIaxjF3mxAs w2V+D0DQj7ur8ALYu7PA9wk7uJvAdIGS93UJLo8zmRQ2CBlEK5L01Stk+J7DQZ74 EqfHons0TCYd1a9EcQe1iHm7AXk1hpFIQBob3NsxtIvg2Cs2IsClkhpYIQTvMRRg IHvroMkT7YcYLzMmQcMAqG44AgGKZPBzKFXNcWkmMU6cBlQR0D7w+WFMmvt254n7 BauDhAv2elk2yHU0M4SkReH11xTW99OvUbaaUixf68ck7fmZtco4Mt/5yxh9p1lc +P7tvaLTOkitVRtiAfUp/eoZSq+5c2MFrIE7mmLxhAxGXGHet9RCyPYm/ASw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1789113614; x=1789200014; bh=1YzKjIGZjaNDnO3ThncOHQEq7scrKV+iD8A Igw5y3yA=; b=A70sC0MH7OLiE1j9Te4a4ATJfKRPKVDjF9+vDZStXqmIAwyVhrM /ZWs2u9ozXoXp46uJ/Uu+9jnjiuZMfl9sV0aAEZu7mlj1+/70XHcqVYxAtwFknaX B2eahpp55epJtmrBDnXALF7b3QPlEE4Q7E4Pz0+ETHKjjAHZAJ60I5u2J8OzgJmS Wa57NCbHieeB2B3FT6tIncPiixnEcaHnksM9MowTjiHoMqm5gxCdaslQ6K4A+EM3 itOad5LMZ9TcnNIyQWORpZvDWY0+Ih3lL1064naQ+fpUe8sYcqCtvXZNM78mPRY+ jGzYVNkqBSzUXbnOeQw2P8vdV9Oa3ioZxNQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFtHPz8MaHtwe00Bpy6VT3ZNpx12b1jOtDtgUZV8zrOGdy9NjJwr4F8GFho6oL/3x G0jv9MnG63JdPgQO/Bfl7+qKqNIsSfkJn8tB7Wdmfxun7QlXAhyUk3RTMhs+EKyDb3d1up EUu17gp8tbrZBh5X2AGd+mBhMAp+UvEV8o8DMgCL3giOpxosm828bdY/jLOu5gDVS1vSl5 bvApJgzwaYSxm82+nwDp95yAtsCS1qwYGycIin7aCVe7tS3hBPtnYeFCyIAhoWyX16uej7 ww1yImEE7ZQufvE9Hr4kchvvL7InxaqtIdw4NgR9XrUm9o/KLycvogzi8zAyk7g1PQldi8 1ORwmMJpyIqaNHQrcft+Q+aP23BPAcjPWreltyBgzQA6pADjBAmi0unu66KOPxzCqoMjU7 fhk+yOotir3NemB5NuIQD6kwsi47FkAaFcgkKIwacI/4B3D4PaoqqF1NNN9TV1U1sLlJtS s9T6p+VpfMN/aZkocRbLRVff2unIH4TJCI+wO41GgMRP+ec/YFW36hKsRjry5xTjNEpD5O /YUDxVo8Tbbu0sRPX19J+IIlHx9/wz77HzCq2RqTrSeGLg/SD6djJByhrITSKz0yA7udwG BpFOtZ9mODQ4E/K0jNjyCK23MwkHckIPJ41wPDNSyOsQwuHA2I8gSG73wVcg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 11 Sep 2026 04:00:12 -0400 (EDT) Date: Fri, 11 Sep 2026 17:00:08 +0900 From: Michael Paquier To: =?utf-8?B?4pmCz4DiiYwyNjIxOA==?= <1991230470@qq.com> Cc: pgsql-bugs Subject: Re: pg_restore_attribute_stats accepts and persists null_frac=NaN Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Y8eINcWNh/ylj0hK" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Y8eINcWNh/ylj0hK Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 08, 2026 at 05:53:01PM +0800, =E2=99=82=CF=80=E2=89=8C26218 wro= te: > The restoration function should reject NaN, Infinity, negative > values, and values greater than one for null_frac. It should return > false 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 --Y8eINcWNh/ylj0hK Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmqjtQgACgkQnvQgOdby QH03qxAAgZvKNdW8d5rRJl2/cHWtVyiF6EevCmvfXPJPvOVPbMQoBCNgP2P2lhih k8bVTZPXp1nO07ovrqcrkSsx1H2Gdep05/xNN9yOCTvuk86mwAE5HknwkFy99aXd fgVSfFQj1RiokoCMyebTOwsUSvD0YBt1eucnm0tzoIJnKRswNdQdtUCBei21sOgz cqoWG+SbB6uiwHkAWQrDWv+ALLlo/7E3zT+co1uDfyUj8ZzZcjuJmwgnpaidXegM KIGzp++zZuPxTAEtSCfX4+0BG0ureJbDiokcFG0pH3TNlyvtvUThx8QGfndZJvmZ UhGxMaGx0oYLmzFGlZ/LRZC4HbGDpwmt0x4U8rtbyWkA0TIydfIxgOQX61Ij/kmY jeCRk154z1JH7ydM6MkV8Hxxhr9OolkMG2IlqRl4rWRsw70GSSg2iO0MvQgLxRln YPekeX46Baym1oKarNm1Kbcz6NAgCTJO52n6XojzrvwAPuyz/J1v83BjxT5T9OuL 783AnBcgvpcA9Ht+HsvjjpHYbIVS6GR1UNHB3mQfmUDlaPQqPuR7yqxSvHaR7OUf TZe5+OYtpuYvFlBuOy0ow2XqXm6/dRX1qi+t83tHvOTuGCKHWT3XOMMaZj2IJN5n iXG0SfIsGlsmV23zLSayyfC0VLl+D2QLGaQx+OSDKwWaoPTrghw= =OZhk -----END PGP SIGNATURE----- --Y8eINcWNh/ylj0hK--