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 1whhJF-000MzO-13 for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jul 2026 05:28:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whhJC-00B0oZ-1W for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jul 2026 05:28:27 +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 1whhJB-00B0oE-2L for pgsql-hackers@lists.postgresql.org; Thu, 09 Jul 2026 05:28:26 +0000 Received: from fhigh-b1-smtp.messagingengine.com ([202.12.124.152]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1whhJ8-00000000PXP-2AdA for pgsql-hackers@lists.postgresql.org; Thu, 09 Jul 2026 05:28:25 +0000 Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfhigh.stl.internal (Postfix) with ESMTP id 8DD7C7A0104; Thu, 9 Jul 2026 01:28:20 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Thu, 09 Jul 2026 01:28:20 -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=1783574900; x=1783661300; bh=2CkmvB238C HAPVI19wlH0ZMU8bxDRIymqXDzFMyf2ck=; b=Xi7LTmcyBW2tKUvgouJZmShUUA 9/MZO93gu7IFQV7WbiblIlqNb68+FP9dY5A3UougiDFpR9VdpmzYwNTkccpcRpL/ iYozsUkXzbG+UQRZandbN8OLF28of609vYlTuSTnpgw0fkRKFfDnYtfKgcS+xhu9 G5WNYmOnPMRWnq4v2QQU2cnSCoraCaB7W+oT5X+kMT+EgeJqHlyqXSGUihSp81IF Phfv9x1vbThAranGySLYHZbEQUolRtkBNPHFVESRCOpetzwZMvNAQwYmGbavr77f XnhRftwPcEmq9LSf/e2pZClptkN5LFwFT32qzEtGqaufLvhstxwBSp56NPgQ== 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= 1783574900; x=1783661300; bh=2CkmvB238CHAPVI19wlH0ZMU8bxDRIymqXD zFMyf2ck=; b=PUAP6ROO9XrdM41jGvjlWG97HL5IX7qc34zb5H2e8ZC6bSmRv2V iDDbtLBM/Xh1CB24BK//GmjwvYi9ORC9Yt0+tPV7TCMbxJTyrIRqFVF0SMwkLjqx XQj9zILWldLYSHwXN+M5Wdeym2Dr6qg4RFGhItyRBeIT8uIMTiWmWuY5bLMkXTA3 lAcAgdS3u8zvIcMer6BUCB1tkgOVxF3Kso8CYmffnDFNSEwJMdmbwMS6RdgXr4FE +VZ53XwVfiQCtIW7jRcRVJeOJwEmcEuBQxUC3doP9OcatPNQgdzrNfi06JLF2TPy koWYVEjgo7YKiotFiIoksMt653lAJdcTyAQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFiVedsYE8HmWHOdR9m72mmm1cgq3R79aAK1KcplWv3ko08rsITnYZY+v7J35iWcR /xX6t7d2k+nlMeXNAtIwE+wP/lDL4DFmhg0bvp3i6OIgxFeSrLImR6MFArfDB35xON80io UnW8ww58yqvtg9Dx3e7nhwyg4bG7DgImgfj07cIxwAX0ImmgU76XfesiPLVE7B1WsxLGff Hv3hYC5kH+BOqWMX323AS1g9axPIgcrQKMm94TMG6VDBD6ufAi/OsNP6CZgPBzuYhhxiXE lJ/Dii5mh9gHGg7galLb/4axCU/6LKtKiktXejnxXMDb86eyaaZdA3YBkRi2D29XZXczpe BrdeMzxAz1JHXf1QfTrF4F7q9hH5xaT/3ZKW49Dzmm6gA+hRWg/pgqbIT2SCiKs5H/D/82 kgm35B7D49hAzahPOAK7/DnuSnLZfxhGXDHwIVrJ6391nols5n/lb95xEfRPCTWckKyTH7 ygAWmIyKCgzY83CjgmwTxogvoKgbJxqt/v+LuAkt4aqFcZd2ZNSUvEz4qq3jiY8y+RKBGx PYUA/bZ/Ohtgyh8WXB+5cetFoo3pQwwxon+k22VIcxPje5Xruaw6jvN0wb5zBz68KiCDoI o4CLkVuKF1FDAr4rdTx7sGnUPdkTnSbv4b3CtY+NJqtoE4+BTOXMhOli1DZg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 9 Jul 2026 01:28:18 -0400 (EDT) Date: Thu, 9 Jul 2026 14:28:14 +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="UlfU/HcsceYPeox1" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --UlfU/HcsceYPeox1 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 08, 2026 at 12:16:27PM +0800, Ewan Young wrote: > Done in v2. I moved the check to stat_utils.c as stats_check_bounds_hist= ogram() > and now call it from both pg_restore_attribute_stats() and > pg_restore_extended_stats(). In the extended path I reject an ill-formed > histogram the same way the sibling stakinds there already do =E2=80=94 WA= RNING plus > goto pg_statistic_error. Thanks. I have simplified some of the very-talkative comments, adjusted one place where array_in_safe() was not mentioned (for extstats expressions we rely on it for NULLs), tweaked a few more minor things and applied on HEAD. > Agreed =E2=80=94 v2 targets master only, no back-branch patches. If somebody has an argument to make here, please feel free. -- Michael --UlfU/HcsceYPeox1 Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmpPMW4ACgkQnvQgOdby QH3PKA/6AgUrpb1VlfaWRBASBAgfUv1Auxsze9aCPb53yAHk4TDDwJP+hgiIzYtH 5G+PZaQa94WzcfVfF9LelluHRaHu6WvfnhxRW49NCdlkWGXlwwjrPyEWWWR6ahrv lORIemn8N5ZbYTR0RNDQ+ZfxdeLmJ7Pl8I0sYDjeHV6lFUITu283cl1naVB+5Lo6 04iVT/I52XaR2mA0jD60lDN5dIVa6eA898W0N0Ckef2mQq3KXLK2VERceYkLlUAX OWKzPf0F+puooKn93j/2wNkQyrZzosFaJqBKcBkdG0mptFJz3/dbDCMG2y8zfKnd PBhKbGzO+zZFUWIsoAjrKXspuc8mk43hFFoKRFAyNu/7Xmg1yfooDKZ7dCfYYW7z Dmk0N9d9fATOHzUF+o6QqaKbJaNtCrx48Ye4BB3XOrK0fmokIy3NXCbzEFKdYM36 A28vmRcNKxVBLXzD0pQMh1Pha6B7X47AAynzf+qUQeYy3BBQSdBgY9JJSLEBNQ3q XZ1IqU0jxOV4ctYipWl9TqtncjzhOUDs4PtRXdv5oi4O90wQ2vaoYEbcH0JZI6Lh ViolLHfQTtbeK5JEdTL3og9tRvMZgbk5JrxQNGx9ub8vC+Oqn1w9g69iPljEpzCX 1leGN16zgqBizFZXb4hnOCBIacmc9v9uttTQCkaIE63o/bPTwyM= =Bwq7 -----END PGP SIGNATURE----- --UlfU/HcsceYPeox1--