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.98.2) (envelope-from ) id 1xMwpR-00000002HjO-3glo for pgsql-bugs@arkaria.postgresql.org; Sat, 31 Oct 2026 00:20:14 +0000 Received: from localhost ([127.0.0.1]:41722 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xMwpR-0000000CelE-1LbY for pgsql-bugs@arkaria.postgresql.org; Sat, 31 Oct 2026 00:20:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]:34482) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xMwpQ-0000000Cel3-3PWf for pgsql-bugs@lists.postgresql.org; Sat, 31 Oct 2026 00:20:12 +0000 Received: from fout-a5-smtp.messagingengine.com ([103.168.172.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 1xMwpP-00000001mBB-0Wyd for pgsql-bugs@lists.postgresql.org; Sat, 31 Oct 2026 00:20:11 +0000 Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id 0DDC4EC01E4 for ; Fri, 30 Oct 2026 20:20:10 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Fri, 30 Oct 2026 20:20:10 -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=1793406010; x=1793492410; bh=S3lJ1Zri4j Lfz4WGf9RQbFYGqTnfJht0a1xThB4zQgQ=; b=ifgBzji8JsxNLcqgPNo5p7e3p5 B9h0WeHLmZ1rL7DGWWKt/5yabAPS2QiDFgkQjgS5QhJ4R75vYMBeJRhlPO5mr/uO uV1ZCCty+j6IcnBssXE28kB06+HhlKAsWslWpd6xk8zZUIPWG31+ePI2nJjGBnB2 heQ6BFQDoNFW0nzb1a9StEKmXapfRfXN8gm5ozc5Z7oaotlSq3XJ4JJAxTE6gSiu GY7S6tB2pyvur9zPCx5UkuNIceJcL1xJsjq3fsDcgbZPj+8wvRwFu93oKgVaK1Y0 vnmHNsk9j/umMR43FqSN3+oghK9mt9otER8QbDL0JmBH0ciBSKq36z/5WxWA== 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= 1793406010; x=1793492410; bh=S3lJ1Zri4jLfz4WGf9RQbFYGqTnfJht0a1x ThB4zQgQ=; b=pBnYm3hv6uboZi6bEPl5EjDrUjZOv4+JWNejjRD1v7LUyLPOFKx 1tAi3rVSJ9AnWABJ6NXqE8FptbR36sYH05gCru9nx9oZtL1pQZH9GBb142BhioM1 jCqQM2rg1BzxRlyNrZONE/uFWPrKTXwWCjQd+lGCk6DVBEvgOXbdyIBiokcHZcEX tbJz5BfdQDIzTHSc42LncQAlkgHEhCokhG8OxCzTLOU5xM6KJS1091brVZ1ywxVi tM8fusbsYO38R477LUslmkOFQzqPDA9Ppodbmu9sFlBPxD/sjUKjlWbeYGTl8wwf 91yR1J6qQQSZkOSLxmxSAKom5CuxLs7yyNA== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-08; repo=github.com/dkim2wg/interop; date=2026-10-28; sw=lmtpprox; action=sign d=paquier.xyz a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1793406010; d=paquier.xyz; mf=PG1pY2hhZWxAcGFxdWllci54eXo+; rt=PHBnc3FsLWJ1Z3NAbGlzdHMucG9zdGdyZXNxbC5vcmc+; s=fm2:rsa-sha256:fh7zJLjB5p2/oB+wnz/xeSSd6sAFLC/c38GasABmQkWMB0W mYR1wztkBYPwP0Oeq94lqKxBmf8/bGJNIoL5bpCwm7fosM1t7cB1Il7URR6MNNlx lFFL7qRGhiSyFTI7wglcP33foihAIaTCaRC/ZtsLsTA+5tqbWu5gx5Atphs4psBI WLm6ZpAieat0xjnqI/FCr2tMWYU2cmhRx2R2I2f9Ipfv9Anbjf8tbmNSXytl0wUr ioT8pIhor/jjd+mNtcH9JwmozH1dAf9Fwu/WruYoBbVUOXkPq2GU9+lCnTh7CHLR aoSNoHSwe4MKYJj2h6TzYj5p382Y1K0ZvZoHXFA==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-08; repo=github.com/dkim2wg/interop; date=2026-10-28; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-disposition,content-type,date,feedback-id,from, in-reply-to,message-id,mime-version,references,subject,to; Message-Instance: m=1; h=sha256:nEXlFA6bFw5KutwKT5Kzu821M+aPYmPCyN3wpXGZP3w=:hwcaq99p+c6pW/Ibu5TK5iXKkcglEANKbwGNDMADhyM=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGod6SZswkGLBN0Kz2S/5qMA1aJ8u7r5ADptic/9V2RjKnA54y2Vt5EpvFCYRvTNQ LUhuT/xoPR9lrqwH2yGlWAPyUeCSkZzojCn1MKtv6eVOwlnhqx41Vdb/VRmy6toRmVqxsK LDRFxGDZTwUHWjgftPttwkPEGS2RZGIVGPmdx5l3taxruT6US/pendAFZbHADYj3dqTkSg PuwzpDaOiuJpH85q9AF2AepBStLAjEu36uvmgu+lD9Q/9/p7W9qsPpO8ggsnDWobl5LZ0N vNp4fbjRpX8QOwsaE8o2obzPe1ItRvW8MvJpTZEC0NGb9TEoCaXsw/O5mTJ2SbR63DwvRI XZHXEqPtAeoTQLQcyQWPACsN8Kyhejw9RuWUvMKG2T5uMRxzc7NWprlOP1HjrVNTDL3qX6 bCJHT427vFG/U/rccmCNp7QpIP3fUcYbXk42kYdFy+rAIgHRg91ulwDRymgMM6oK9fyHGK 4fJBgHVNyC5zne1/KbpHwfzPN92yf5g0ZEeA/hMgbHtgTYN2nwzY0Ot6rg5H3IUULLGsb7 d/0Ntfap0ukE9cYqiyhEO9v9iak+j5uUOuBV8hkPvUh6N3AxY6OfaQZBAQYdluIhPVzylx Oa+CNo59+PEQXZa4NEt3mc5m2GuVSHPUupB8XcyGUsnYuxA9zVBFqGLWbgdA X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 30 Oct 2026 20:20:07 -0400 (EDT) Date: Sat, 31 Oct 2026 09:19:57 +0900 From: Michael Paquier To: mingjie gao Cc: pgsql-bugs@lists.postgresql.org, 303677365@qq.com Subject: Re: BUG #19821: pg_restore_attribute_stats() accepts an unsorted scalar histogram_bounds, producing badly wrong row Message-ID: References: <19821-0aa4084a3c6d9899@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="grABeVAHCup+0dLc" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --grABeVAHCup+0dLc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Oct 30, 2026 at 02:50:28AM -0700, mingjie gao wrote: > Given that discussion, getting bad row estimates from an unsorted > histogram doesn't seem sufficient by itself to call this a bug. In short, if the restore functions lead to one of the two following problems, this may be something that should be adjusted: - Crash of the backend, due to an incorrect loading of data. - Assertion failure, where we may want to switch that to an elog(ERROR) instead. If no problem of this class happens and the only user-facing behavior is that the planner goes crazy, there is nothing to do here. If any problem in the lines of the previous two points can happen, please prove that it is the case. range_bounds_histogram was leading to a weird state of things when loading the data in line with these two previous points. If this is also the case here, please show an example of crash and/or assertion failure and/or elog() failure. A elog() may not be worth tackling, the other two ones would be to me. The original point that stats injection is a feature and not a bug still stands, up to the point where the backend can hand its own and not take down the whole server. -- Michael --grABeVAHCup+0dLc Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmrlNC0ACgkQnvQgOdby QH3DrBAAnUMMDZkYtEhd4yW5d5PlL5EjOoyrSjCDANftDNTrSV2mFKfgsKnSUvXT FhXJE2ID/tWbFhqUukXV0jyKRrVKw/dT2gp7AKfD9+ZKLpGhIYc+0jr0g5dXDRL5 yXSCORK021qtUEWECefxAcg4frNyrn24cmrBxTdtXVk5rx+RKtWidqDGurjFygGC JAA+NZgh4W7wAJSZB6wB3S8FlJGRNY8jqtPHrSuDPmBz8lN6K5/sOMEME3eAx1a+ uvIbSYvp4r+ux3wZmf64DasrKWR8Myqp2dIsT5L+FktFD91BI4rctdn7riluBWCQ IXHtZx2mE6rzQBVmZn3kWCmvecJJnjAWADy4VXJavN2hQwGnZGut3MXaIelmaJMg tM4185lxnJHZhRrN11WW7FXZHrnz3cqYpaOnben/jPZOstbB9gEJ+yc5untExlsS ZqAfeDBnFHNieBPRRlzshAieDM6kOe0vyN8y0l0X5Gtdk7q3D95ZuvEPFUAu/0zK 4t7rVhzvgi5FpAtaHdo1XWbQ0aI+yZ/dR83d32U85jRN5Q6qcYt4iHaVxkvPyAvn ub47lp70pemLFmkI536cmA5Jlc8eoHc08qQxjDcm8CDaHIPeyYdKNIooAtmCXvNC l8OR9IYvYIU/3DC4H1VaYOdHTOUdMw9PZxG/VwqkxXifll14j0k= =RrS0 -----END PGP SIGNATURE----- --grABeVAHCup+0dLc--