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 1wxJTT-002bS2-2o for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Aug 2026 07:15:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wxJTR-00CCib-2i for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Aug 2026 07:15:33 +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 1wxJTR-00CCiS-1e for pgsql-hackers@lists.postgresql.org; Fri, 21 Aug 2026 07:15:33 +0000 Received: from fout-b4-smtp.messagingengine.com ([202.12.124.147]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wxJTP-00000000RzU-0XpZ for pgsql-hackers@postgresql.org; Fri, 21 Aug 2026 07:15:33 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id 6429A1D000A8; Fri, 21 Aug 2026 03:15:29 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Fri, 21 Aug 2026 03:15:29 -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=fm3; t=1787296529; x=1787382929; bh=NhRQCmn1iN N72iJy+x4hgk/QXWOzFFsasb5UWI4xLLQ=; b=aQWTz32hTFAvnXLyqMJA+FnQ86 SBfei8kCcTsTuTr2J9rF8sgnz3CSvNGhE73giaGwU7mBFzhEDbdCJBzB8Dk2DLHW Gt2EY0/O2pIFO1KAHu+tj2UFuaxQftgT5L2Ul5GK1UrkBBFLuccq0aAwQcf4EvM+ Nu/BG+BeREm4NulDijUgVf9f04tsQizaveR2KBLxdWWtXn5zFQwJRlcdKovWppYo x2by6RQeKK4bpIAh42nHMHmbV3K6BO/gnZ+VqsUFr6eXuvYRgqCgXF7vnSeMhzuJ IUz5Ohf3TrEL1bG1dgVXcKYoqwx5UokReptmTmKmJb7Pb/OxkZJAQQwMc1cg== 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= 1787296529; x=1787382929; bh=NhRQCmn1iNN72iJy+x4hgk/QXWOzFFsasb5 UWI4xLLQ=; b=cXuEN+4WaCWhMY9+BUjaB8ptnYrhUKFdI8ZIjaD+Hgb6NmT6lNz eA3jB8dhLE80uGWOpuNIM61Xxk2v//ipm6a4JBOlekpDQ6ByVCqA0EyHn17xLrG7 Zb2A6k9btu7k0GdT+Z8fO+YOUs8GIPUqqzJLJ3iL4DELlyOwvRXUDsmJIJkgjLBv rxt41hqknKTJLCJyjN/9qZOMC32iAna6N+TFTuPDG+Lk8R2NKOVO5dI/X7HVywYp peMlYFwpUrY7Z+DCGSd28lBtaKuMDONRTq61SN/n3q6rfhhDhVPwBZFc6yOrRId0 xWGHou4oMBVPlbkVI7EgPodMOQgWqBbNXBQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEdb1Oy/eR3IZPunlN5fiokZMdIX5dxBF8/NPqmyVv5QoRYTB/vNqlUjp2twjZqQA 4//wPhJdjN4AeOPRa+19M4YvOXwsPH3Cwnxc7bCTLgGURvyYSOB4jD1ZU/n1TcMHpOynD4 +vYSoKHDsYLe7hBEjxWK+aTYazsArB87UlOe1Y4cxONFH0Wz2Wn20pdgaq18CvhbBVdKkT yR75UDbOsQsAx//AM/f0Do0KOHGIwH68gW+tbjtbS0Qjl2jsvOWxIgalpRwfrMpE6c1GBT gVoIv//s7VjcTVRUkPTcD9M3U/pTIK4pCv9uebfvUaz5J/6C9sj9el7kqZmiCkJOla13hM j/vRn8MC2qsqsRIUgclFIyo96+KqyRblvPp47E/HiZqrJJSElBga01ez7n7oCQtMV5BTYA wBLjnKjLxK2xeNyEPEf9jDUujKx6SYO7qWk99ud8Qrb8LGXbnlHfo+ZNX8BrZ+lLek7rsh sOBAmB5UETvJTubWq+k/QYzElD07Y/OR0C2UXY9mIKp4gQQJCHFhGgYoSJKtOuD7RfOzYZ LyboGj0JWPg6z0F9eEb/aynEmi/iHhbCzCw8faFzlbPFYyHX3hzamdE6VTtn7tW4FQy4ed ZWuTy0K31tTdLsuTWiHDiYb3TNxOW33I4J7ZCpKiIqJhLJK/cDCwtpV/ak6Q X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 21 Aug 2026 03:15:27 -0400 (EDT) Date: Fri, 21 Aug 2026 16:15:23 +0900 From: Michael Paquier To: Corey Huinker Cc: Etsuro Fujita , "pgsql-hackers@postgresql.org" , Robert Haas Subject: Re: use of SPI by postgresImportForeignStatistics Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5Ir8cP4WzoUdSSEd" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --5Ir8cP4WzoUdSSEd Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 20, 2026 at 12:28:30PM -0400, Corey Huinker wrote: > On Thu, Aug 20, 2026 at 7:43=E2=80=AFAM Etsuro Fujita > wrote: >> On Thu, Aug 20, 2026 at 2:15=E2=80=AFAM Corey Huinker >> wrote: >>> 1. Remove special handling of version parameter, add it into existing >> StatsArgInfo structures. Not the highest priority, but doing it first >> remove the possibility of having to re-adjust subsequent changes related= to >> the offset I'm proposing. >>> 2. Remove construction of of FCINFO, going with passing the latter >> portion of the positional NullableDatum array. Just looking at v3-0011, expanding functions like attribute_statistics_update_internal() so as these use a gazzilion of input arguments is not something I am on board with. That's bug prone in the long term. If you wish to eliminate the FCINFO part, which is, well, not completely wrong either and does work, I'd suggest to pass one pointer to a structure that has access to all these fields. The NullableDatum seems to be that, but the patch does not use that so I cannot be entirely sure about the benefit of suggestion 2. I am unconvinced with the value patches 0012 and the follow-up ones bring, as well. For example for the recovery check, we just hide more stuff in thin wrappers, and we don't have that many entrance points with these SQL stats import functions. > Oops, forgot to post the commitfest entry: >=20 > https://commitfest.postgresql.org/patch/7170/ A replacement of newfcinfo by a different facility in src/backend/statistics/ has nothing to do with SPI and postgres_fdw. I'd suggest to: - Rebase (and refactor) the patch. - Create a new thread dealing with the specific topic you wish to deal with. Spoiler: v3, which is the latest patch set I am aware of in terms of replacement of the fcinfo, does not apply cleanly on HEAD. Looking at the patch, you also seem to update multiple times the same area of the code, that makes the result more confusing to me, because the result you are looking for is hidden in a forest of cascading changes. -- Michael --5Ir8cP4WzoUdSSEd Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmqH+wsACgkQnvQgOdby QH2OMxAAjG+SHoki/YwFg1vnYG7WJ9bJS1hK6SrA9l8cbkOmkoRn78HioFfvRKv/ LLFYdfSbMFcCKZzeVAdttg7FNTq1nZhiybWyc+6nzebcthkNU3HThvBCIptFs11s aFFkhWIbyvNIdt4cq2hia0yqXWV7XFf0/X5+DjsEXm7TqfouudaDyH5TYCyhFTlv Gu5WRBnSMHHq1YyTBFp0N1Odu2utqgG+F4g3XPdB0H3hBtq/WSblxJkrJzCy82nq ACx8tTGC24pFpidxSRV24XsscnzLhUYTdqoilBOF5CXLLluaPPjA8jBGOxcxuwGm A/Jb3NggSJ1W3cNlQROoMdhqLGG2WWNgssKtm0Xuv4mK/8SxL9iBAu+OYTtXEgeY YFkOXWWAYefv9EBoz9MuhgmEMJ5NjoL/0N2TN4/m3xblfAtBhGzgJhBGbOpbjAk/ o3Cl+T5zQ6MtoxoIqhdyldHeErQZAYSUJdKnDP1XyhaBeOC2uVFdTKFKXRvYT87p xVLHbpQ9zZCGc1evIwv9fhm3ym78/nEINihR2t5OOD4TU9l5F1IU7LuABCCQt4/A rOhJ4uhEWzxRqKT8ntcnbvb1aGsBct4tsK7RtyvQ40GSmkiVq3ZRK0no++UWTLMz x8/NHj1/y+Zblf3c/EG+vSNjK7P4+pas2/HomGgdR9FPQoRyDkc= =JZsT -----END PGP SIGNATURE----- --5Ir8cP4WzoUdSSEd--