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 1wh19C-006cRB-2R for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jul 2026 08:27:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wh19B-005TXH-28 for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jul 2026 08:27:17 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wh19B-005TX9-05 for pgsql-hackers@lists.postgresql.org; Tue, 07 Jul 2026 08:27:17 +0000 Received: from fout-b5-smtp.messagingengine.com ([202.12.124.148]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wh199-0000000204g-0eti for pgsql-hackers@lists.postgresql.org; Tue, 07 Jul 2026 08:27:16 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id ED76D1D00084; Tue, 7 Jul 2026 04:27:13 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Tue, 07 Jul 2026 04:27: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=fm2; t=1783412833; x=1783499233; bh=2wJ6JI6Dl7 P4ptRY7aZKDx5x2VOVgh3VN+JBjk9ZNRw=; b=Jqs4GJtvHBoIoYmngTSHDOi/9i GmfVwKh3rNxAWZb7KNZ3chtZ68xwFmLt16SmPOoI/OaRGWKpt6IwczFSFrvhj0bt PftXVYwaIghLjV3oXODMWQW3tdGu5nuTVhK6U+bQYcguGkuNdLL0lcjcKbzCIqhq epyZ2nAh3UoTkoeEcdfybyQVYAUlmTp0Hp3qXh8mNQgwUnsw9AsUF0Z0avEplG8o t0t5EvvoHa5sScXrdoRcQhoxe1QYfoHgnyrjsB87RPZAlBC3qxrVjv7thKWOUm1F znJsbo1767jwEAdp4MzW7KMAh8ly6pX7OIB/JD/atmXqHr4C7ZGAm5S/xOUw== 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= 1783412833; x=1783499233; bh=2wJ6JI6Dl7P4ptRY7aZKDx5x2VOVgh3VN+J Bjk9ZNRw=; b=kPRgh87UQvTiH2Vuawk6aafx9GhAPqCD2XukMQBQjVPtdGeJ1z4 uQ9NLgK1pKI0dbdddxWuBFxkXuXK5pPPRiimrh7pW8E5TP4z1iK1U32u3vpY8f5m 6ArBzmZvg0LzmaAfz4NPCiAsaBPqh2Q2LMeVQGjfBx1vBV/t6ZDh7lgeJbsKW7GM wAo0vGqPzDkXghwYGJ+uDyu/0X/MqWwkAiKDLj+/9qzcAOSfuuzNsSQF7W10p1HB iMA/rehnL5cJJg7wixoUe0MlX9QoJAmgteUxIT0VZMOXkx+eGw6nKSmvUtudXxJW EdqNowV4qB4Irs7EtESv4SSa3JOoks4Olxw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGgKBm3MJjzqcKQ8RP8NqPwwNzM4MoS9N0GzXi0UAb66Zs0LcuLoKudtE6mY53Pnd 7PWhd0yCZQl3Y87X+6Dgcy/40FVO1IZq4tOS+yXi98ugntJO89mYbqLfIkBSkiaCoeSt6X sRZHJ3hG3Nw8hB0fkobtdiv+8QG5gPbfQgtJ6BhXjAW8zbbEAfboV8thuW4Sw37pS1fBON LXMcO6hTvlpOqAQpH3QyNJehO2hjavFbOT7m9sXMEKs/hqD4TuskKp1F+Zl2fia8yvehX6 Ow3HOI55xPL5d71ABS00x90mjL3M3xTN2nu0ve2SHp5zwgfCVlAY0dZYJlgR3mwtdUkfWH tS5Dcu++RT0y2yBoBfNDGkxixrgPYgMYXpmG239U5mhKl5z2znru5xCnhqiBXXGpB3gSFs 0HFiUco8oYRQmbJ3KL4GhwOicYmE2WdL7qbq1bNQIYtmY0k+ulWlcL1VWXHr7QTBvG9TYG RRv+6PK1pVPvYipHKNrmLGVZD5YqUcAZ6mjQL6cdVyj1rg/4U+87DBAqZ8egatgZdv+Va1 2xq2Li2WUx/P8Gudf0DqEHKt1oPHOFT35iEpV6gzcaoK3bhezCAnr/ja/lJoEsGdTY8962 s0dQktcsrch7a9LzgvXMRDAfPQ7D+srUaq/ZkdjqrX8HPhNHwfyRdi4USCMg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Jul 2026 04:27:12 -0400 (EDT) Date: Tue, 7 Jul 2026 17:27:08 +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="Am92ySeYKXy9RtkS" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Am92ySeYKXy9RtkS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jul 07, 2026 at 04:13:30PM +0800, Ewan Young wrote: > pg_restore_attribute_stats() (and pg_set_attribute_stats()) stores a > STATISTIC_KIND_BOUNDS_HISTOGRAM verbatim from user input, checking only > that the argument is a one-dimensional, NULL-free array of the right > type. It does not verify the invariant that ANALYZE's > compute_range_stats() always establishes: the bounds histogram must > contain no empty ranges, and its lower and upper bounds must each be > sorted in ascending order. I'll check that tomorrow. Thanks for the report. -- Michael --Am92ySeYKXy9RtkS Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmpMuFwACgkQnvQgOdby QH11og/+OYwRbxcQ6bBW33EtgJqZWqC/Qpt2NDA6U7LXAfdBaUmvvNJnSLw/ArvF lR1AO/6zIsYBGnTJO9atO8ggzUAVUKdNUmOZSZtQJv86p4wqjJP59h1T3hXEnbd9 NRTAPNxaLwFJqVgJzsFAfb7G3t5eaw95iRLPOZq9n10DBH5txjMMjNgQY9ULyyv1 VJFWsKVRZoCLPEaZZGcodZz70dLAQhq7YPHCTIH72LO4iJnOKdRb+vcb4dijD6Gl Lh8C6UCqKYv71P8oCXT1YXwhx1vsNUZJaZpKhnU0Z9B6ad2I3g1eHxg2Ruc27Gr9 yJFmpwLPMkUj7GGPgWDpv9NVljtK+aznPxVrsOTdAb9CCBhulUw6BPz4HFIzcswC 0/8uleSPycbSMyIKfmQwVvHOimq8dkJcs4AY+qFqm/FejrtPTgyrE8RujeS459Ln mNKNHUudHQWDue/iFdyb9cF8d4KzaT7sO7ijY/V2Ia+M5ziZir91pI8J/N7XDFW3 0Fkc0J0ZBGQHRh6ywhHM4P50YyPa0+MPHPJrpthMcVcVlpDLHqi52rHQiQoTjD8N KMAsSewzpbvjPFvXSKz4BOphoFRwx9rjSKxSfaQN7Mik70zpurIl1wuOjgsDpASs hPcDM2mWZ+FofdalD0L9rO6Bnv//mqYiwJVDvJ0fwSW5xclD2us= =R/Vs -----END PGP SIGNATURE----- --Am92ySeYKXy9RtkS--