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 1whHqj-00083R-1N for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2026 02:17:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whHqg-004J2l-0X for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2026 02:17:18 +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 1whHqf-004J2c-15 for pgsql-hackers@lists.postgresql.org; Wed, 08 Jul 2026 02:17:18 +0000 Received: from fout-a3-smtp.messagingengine.com ([103.168.172.146]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1whHqc-000000009Rx-0Xdz for pgsql-hackers@lists.postgresql.org; Wed, 08 Jul 2026 02:17:17 +0000 Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id 701C7EC01F1; Tue, 7 Jul 2026 22:17:12 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Tue, 07 Jul 2026 22:17:12 -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=fm2; t=1783477032; x=1783563432; bh=utNx3j50J5 R+4sFFwOZqUTxom1TQb2jAc58/KZBRnu4=; b=AMDv3HFNCeoBMWpGdwseXo+uB0 zLZAr9CTQe1MA6k0RNKnNZysDPkkCm4hmarqJsRErXjGc/Iu6Lckx0Dr+2HNZ0VJ jHhZyEOyXHLzr0mID2uxbvkYiAn1N7SuIhrPG6N2FYKEYbIWCHyYFX1Csx2WtIMr DFogWXGbXXXdpDXSQBjW0SZ4iYS+SuzXfOMbPVJudx+M1PqJ0MZHqMF6MmMxSweq riFFNobi5dSeaZoREVWG6szgWYhetNvgqNfZFEcycgaE99wIvD2bytooDUVCuPxu 9EisNYbX3u3Q1Uc1FZHOWEIZqGlZE2YqGechwGDDjFjVrG06G/v/VH5/66AQ== 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=fm2; t= 1783477032; x=1783563432; bh=utNx3j50J5R+4sFFwOZqUTxom1TQb2jAc58 /KZBRnu4=; b=FxF0E57HhfHhpC8xW63HDzJWHsKxFmZXWgqrjdRusctAIQRotjh 3kEQj0/6EmpsBVuR0PN9/c01hESNwdwlffwJGC+OUqPSk7gfzD9ku/wgqcEW2kJ0 buJZzSxzDijWt5erZnhL0RLaWtlvu7BJCae1UKcfs4637USOvp7ICIdr6l+WpNBW NuU7KmcwsDbmu7lakh9BBQlh8/kvnA9GMCwN5Jc/FcqNviVjCDn5Yyebz4SFf2wC vIUkjF5/+LC4VMqIsAjZbOW1U9ZR3qDgaAbxD0pBaBZFcNWgkCHu6mDe14Bj0/fi vtbm5Pk1RSkcvdxHN/CO3eKgDIb9T3/ZKoA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEz7oZEgFkPH67hXmmBivYJ5opdv39kBsSSGOc3RjdW4ddN6Dk4YWLdjzNng35lb4 w0N8PNydK3jvmSypu+v/7Q7lLtRr+YJW0DiPvAWdF3R7dTrRQCtCDOEBTUD0w/nqHD7FVL 5gPiwk5RIOXVnWk4LPZrVASUsb+lvvlZgKnNlw3H0tL4Y33i/2XFFletdZKdF85yrpTtIO TORFReI3HZmdIBhbJ+D9dSlSd9+tWEalsEoiWl2qQTM6Ldj1aFUQIaSmrD06cIplqX23O3 laBebWjU5RisFPNrA3tO1LaWStzZ17o51pksAYiLq4auxAGDNmYnXRYi+DJVbCB65uiErv KLS9EBnWzy03sDVgkYHZzx0csUFa4Chx74pGdCt4PjqalUhJYN1VuwoiwUt+vxEqJ2mXvY lE63jSxZqWoprW6FkxhQy5yMetMfxMqNmv3vXi2m0Zl/W8liKChT+G9Q3lUlvy3hEerhmx sd5jBJegv7KJqh3mOXk99ZJ4yyZ+sbWOXwO68sMfbkexNJtpYqKPYH/wxN/oY4JlQOSX9r yjuw9aLwwzeLrkeaSQEMI8TfTcA7Gh2Aj6GB7HzHQXbn7j6DtDC7AaugxNvw5ymwbL/GgQ +YiGfdUTAnY/JVcuujaoCKAqHhUPbnHia47JiGE8Gvx4GLYCu+PR0qJ6XiFw X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Jul 2026 22:17:10 -0400 (EDT) Date: Wed, 8 Jul 2026 11:17:06 +0900 From: Michael Paquier To: Ewan Young Cc: PostgreSQL Hackers , Corey Huinker Subject: Re: Reject ill-formed range bounds histograms in pg_restore_attribute_stats() Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Htb0jmk6j8zAXD80" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Htb0jmk6j8zAXD80 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --Htb0jmk6j8zAXD80 Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmpNsyIACgkQnvQgOdby QH0/VQ/7BqaBrOb6y/RQIskdFsMwYkF9hRcv7qE7jtM8EvQvdqq4OspLLn7jREXG tkVFwdFvIUmThrlnwd+6Yh4TVqGHI3q/OEqRyCX+X4fIlMxEv+RHaSlFk+OZUZAE 7gqZDkXHxEOBydxiWl76Bkr0stsNcH0F98NheMqzy40uZ/Fypi+nuMLT+waZpj+c j9X9xy8ddT/OZngB2kB6jxv8d6r5SvL6lt8a8g5qdDQTmjhmBX4ETxjLWTekK/Xr +JCmV3CQkKHAOF27T1AOWzAk7wJP/cWSdUstg2v1o611qDOWOUzfSlDF5nPUIGuj uv3VauHS4yfuIqkaoaEAgX7i0Jv/xNCZ56nNPjtzJm2ljIVCfUCpBOPTe4BrEynf MFu6+C6X+QeSGtHWkrRGx15s74QMXEQwxkczVF3oQHeTnrAj8mvJL64kZXiaQlgA IyxQQM1pz7cRXw3LoYb8vyHyYdwxDWqoA8FpifEkPkjyCFU0x5dKLJE8Wp/eXuLO KRm9xTzibZRKMXow/kvH8znEZsIfHFjJnUtvqRO3dzboPQQz9LBcEoly/UwZ5GBX bxbj6NJ2D9tx5ewfbamK8GMs7sQfvnS2TTDps8TSfT9BaxwuNV5t51soSw0xrRE3 lwzmwPgWG3DHlHGhpTYNZeSYiEeH5/4uhwaX3+SC+CdGiP/9dso= =tJL9 -----END PGP SIGNATURE----- --Htb0jmk6j8zAXD80--