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 1xRkMz-00000001Gnx-36JN for pgsql-bugs@arkaria.postgresql.org; Fri, 13 Nov 2026 06:02:42 +0000 Received: from localhost ([127.0.0.1]:55882 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xRkMw-00000007uEE-2O7W for pgsql-bugs@arkaria.postgresql.org; Fri, 13 Nov 2026 06:02:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]:55624) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xRkMv-00000007uDW-2lb2 for pgsql-bugs@lists.postgresql.org; Fri, 13 Nov 2026 06:02:38 +0000 Received: from fout-b7-smtp.messagingengine.com ([202.12.124.150]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xRkMu-00000000hWz-0h4d for pgsql-bugs@lists.postgresql.org; Fri, 13 Nov 2026 06:02:36 +0000 Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfout.stl.internal (Postfix) with ESMTP id 871EC1D00421 for ; Fri, 13 Nov 2026 01:02:34 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Fri, 13 Nov 2026 01:02:34 -0500 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=fm3; t=1794549754; x=1794636154; bh=lM0jeabcyD yqaauM+lYFx5yWdvZv62B4jd6vPdd/tRo=; b=WE77LWX6WFzr2P2paVI6SKbwWs MzOzVqfGPJeqRYGgLFJS4G5Y+LAo8o8DQo/E5EoGky4dKq24e3TZZlA0Xs/3avax cdDTOCNIbykUG/YQTBI9/0ru+dhSg1CIMlR0gtw4++G+74HYu8Wbgh74sgk3RRYz Z+2pT7YYhsDTY/or2e+hlY445Xgzd+gu2Rv0cPzyFkGr/Tc9UEuFbWfGH5LEcdbA rGMvB9RWHNlxiaP+6Dup3Wnd/a1AtlMCrzBnAd1/fErbnbBN4TpPoP/cXrdijIYF 7vZU5BAlz0MhVH3hYh4xyaKkCa833oDlOAN3GhvaPglzR/9bAcJYJ9jOFnHA== 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=fm3; t= 1794549754; x=1794636154; bh=lM0jeabcyDyqaauM+lYFx5yWdvZv62B4jd6 vPdd/tRo=; b=4Xoztj+bxbH88tsE+8VIZDNVf1/Zn3FQlvvh8FHxWaZk4L8wD9c mATbFdw1c9KDXnB3sEEyO56gcQu2n9l/uiZ8Ig+L5BTnRRfwp0WAwV9PFSzrmARO Ecve0fgxOv1+llfF9vJIoUs8/jI3ICbJ6lmto5xpqoH/k3IrBH1v44CbUTwIqKN2 wR8JfVB+1C/KrahiWrCaIPsA0HJQl0hU6hntlq6vVGNQVA9j+7iJOWKjxwRPwJzK XVze6YKb+IhKUQX3/pvG+CFwYzdDUK5athxasTizCzOTBRnt5f85VrRsJLaPuyM/ ugYOy8C6dRDZ47k7U/mpXFWGm+UtrgpGGgw== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=paquier.xyz a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1794549754; d=paquier.xyz; mf=PG1pY2hhZWxAcGFxdWllci54eXo+; rt=PHBnc3FsLWJ1Z3NAbGlzdHMucG9zdGdyZXNxbC5vcmc+; s=fm3:rsa-sha256:P/RK0Xu63jfX2oo+wn5ab4Rz2rHqGH3pvVoa9sq1CCmMxVm 1Y2ihqJYXhpuKo6EiSmHT6/2wciyP38my1qxRfVZ4+ZB3vDDK9H49ZqGiegXD86a CZU0csUdEpVW8rFLq/sY8Btv8ssWGrGZ9XXRgT8DBaWWsC0t59S/tjIB3LxHErGc 0c0SQUm2vwAw3BSP5wjYOOXeAXtGUQlio0Kmk+Ib3IyVoLUV5u95S3X8IVLh+HEN zeptMQzkDYrS75E8viNGEAkacjkU3eQUwxh5ALy7sSoKmzvKJz59GDhqnj/l76UZ ZSSMm2t9JLbPJjelzdX9O4LPhXsZtIFggdtpxbw==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; 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:37/tp+BYrVwWBhCLTD0RthQ8dd59KDqYquHAlp26HTs=:dRhROX3/rqCiFrPTbpnRksaueGndjoenlJlPEgI75N8=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGtOX31geJ4c7acSn8n+m2JGtuHnvt3TblDnyhexGr9JEbYutHLwIGLGJ9Cem8GkP CIfgFysOeZuP4suWXY675vvOly0lY0rVFGRmA3Z09g5ShnlBFdf6YNrPzc5vskPt2HKKUd G2qpF605HlWkSfWN+fHAfpH3Pv9ErUnQJHUO1vV4dm0N0wM6DaeDtL16eP85V2AeJCCqlV ojp5yO2Lh3Ie93BjG58D8NPW0giSXCZbiIKKx7wJXWQxPxYx+qmnhBeAXQtu1pAJDGKEcd tmK9xY/LSJWKcPcvlV/iy2BzZn/1b4aFE88JkvbtBAclVyE9YOh0g3QbFFyNxGBBO0CeR3 T4IIktqzUNnAc80SCyhXEU6HneIMPe6leRUUkQtNWwRl766OjBNc7YdzgeniwZsz2hyhLA WFKmld+fKv25HLRGIgYT0qF6xC1616+kl3DCOxTuEftCjZp51ZiJTalzsC5l7G6P2exa5J 6XjL8/QZGVzu6i8E5wuNhCwgDC4acqGOaeJVdRMoCDHG75o3pv4hlSrTJHKLdqJ16IUNQq BYXPhNoOCP9dHNrRTeBW3/fzC8RJ0DABsdmxSLNx3d6/C3NM8B/2oOuUP9BtvJTOqMTFA5 5YJgmriUUQxb7LHLqBjIn8JBD4tlgKDcy1VuxlldQ17dWSEIEWUuT2XBlfkA X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 13 Nov 2026 01:02:32 -0500 (EST) Date: Fri, 13 Nov 2026 15:02:28 +0900 From: Michael Paquier To: Corey Huinker Cc: 303677365@qq.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19842: pg_restore_extended_stats() rejects a faithful pg_dump of ANALYZE-produced range expression statisti Message-ID: References: <19842-ca042326dd2430a4@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zPBDpZboHcfb48Gc" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --zPBDpZboHcfb48Gc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 12, 2026 at 04:07:54PM -0500, Corey Huinker wrote: > 0001 - > Decoupling range_bounds_histogram. No changes since last patchset where it > was number 0002. Ah, I see what you are getting at here. Without this part a portion of 0003 is actually moot, and the reason where there is no point to check for range_bounds_histogram in parallel of range_length_histogram and range_empty_frac is that they use a different stats slot. Tweaked a few things here, and applied down to v19. > 0002 - >=20 > Fix to pg_dump to handle NULL values in range_length_histogram and > most_common_elems when their corresponding stanumbers field is not null. >=20 > I was able to test this against 18, however I [1] was not able to > synthesize data such that an extended statistics object on 18 that had > expression stats with a NULL most_common_elems and NOT NULL > most_common_elem_freqs. I asked Claude to try to do it as well, and it too > was not able to. I have not been able to process this one today, unfortunately. I had to choose what to do, and picked up the most important matters based on their priority. > 0003 - > This has the same goals as the original 0003, but using the methods laid > out in 2656f664616d. While the code changes were fine, to allow for empty arrays like in 2656f664616d, the tests were bundled at the bottom of stats_import.sql. We have already sections of the tests that check similar patterns, so I have just moved the whole in sections that are more adapted for this goal. Applied also this one, after some edits. Should we also include a test where empty arrays are allowed but we have a multi-dimension array in input? I have refrained from doing so to not complicate more the patch and there were enough tests to check for the basics in terms of v19. Your patch did not do that, either. 0001 and 0003 were by far the most urgent items to handle for v19 (and actually the less risky ones). Without 0002 for the moment, it still means that we could miss some stats at dump/restore due to the NULL/empty change introduced in v19 when upgrading from v17/18, but at least we are clear for any future moves, or when doing a dump from v19. -- Michael --zPBDpZboHcfb48Gc Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmr2p/QACgkQnvQgOdby QH2XUw/+Lef7S1xD662MSaAov/1UOe1m+WvMwTI/Fwq/Q6vdjsx/0e+KiN/BrLim gQDlxLSQV7CmV20gG6ylMWU8Pt5L4um1XNyD9vY/kvFLEqvnKDkLh2hI+ARpbMmy gee74s5UuzsCtA5b4jKlI8xlBVzgwPdfj/iiT0HVA8EJdi4pBh/pIqkVzu5V04X1 iOJPb+dEtn/ST4eUjchbsYUlR8dfcNzwTNVEub+g2yr48n/bbx+eCPE97aFpn0pi AEI+NhVLqBlHoNwgZ3E3+PLRZ2fL5Qh+cLL06miCKTNOkBq+SffQZH62M4LzUiVA uA4yb/ZO+bu8lGju3TsG9s6P/D5Z9aOd6h4JtXibAuciUAyMyPSmco0RzTvv582t dZdhXOlCSnmez7mI4Fvpk+K1qxAuamrVWDKOvMHnZy+4LZTcGlqbWTbp7UTfylni 3qqhpo195Hul4ALY5/gcqzyT6ULudOZ65Yt5f614xOaPqF2ia1o/WQ36NQ5Moffj 27OGvbSGeUJkNltSDlpLuFgbtIiSqQ131C7GhRQLwFuNYFRx3bEbzL/xJq6NPJS8 Ir2Uy+d2/lXmSVoyi4tGEoEzoRNkm52zIxp4h+8r+RGQy+TNZOC1oQloLzNinytE 2C3BK5Ohm/sT2Vlbjp0PXMnG43UTuoWmy0zoXV1fsrr5eDUNaC0= =avQi -----END PGP SIGNATURE----- --zPBDpZboHcfb48Gc--