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 1vLERB-009BVO-1k for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Nov 2025 05:39:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vLERA-004AGC-0A for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Nov 2025 05:39:32 +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 1vLER9-004AG4-0i for pgsql-hackers@lists.postgresql.org; Tue, 18 Nov 2025 05:39:32 +0000 Received: from fhigh-a7-smtp.messagingengine.com ([103.168.172.158]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vLER7-0007e1-02 for pgsql-hackers@lists.postgresql.org; Tue, 18 Nov 2025 05:39:31 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id 3C91F1400219; Tue, 18 Nov 2025 00:39:26 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Tue, 18 Nov 2025 00:39:26 -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=1763444366; x=1763530766; bh=yqGC3uCMmz 4uzscNMa9RCJJaXJI+dmhHrPCeJdrDtJY=; b=xsu/fzn/9tA8WxKhkUAq6clln4 C6tZPiY9hldanQ/XL9LJruFShObeLie4yJhwWpu4+W/KRjwbGliO+PKOf799a+r+ kuumhNFLXOQxN2CzmBGt3sm5X0kSAzVoL6f8jy95sS2IxzaSrwbd4U0YQpRpbfbK b+oT5BL05x6SqM1b27OeBKnEc3IumVLs0pem1ZPzN8dhzxCk3UDImgCX46WZDLo8 zHkO2HxlhMNgmd9KlBmvGZ/NMTkB1CANJe12sCM7xUkbESsPeo37ZnHROmql+XpC c40Sb+qFuncgqCvuJ4QTGrKwXkg5dsKoDDw8NVd2+OU5V/Ijz8B2iiceCm1Q== 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= 1763444366; x=1763530766; bh=yqGC3uCMmz4uzscNMa9RCJJaXJI+dmhHrPC eJdrDtJY=; b=o0SAsMR3lKNDfliUaR8MCjrsW+AjdUwosathQooKHSMzYta51PL 0GWbFnKFhTx9aj92jcNekU1x15wLWLTNrIFcEEF3wSB8Dien/e3zoctlWksv1bWg Z5hwq58ZsHEUeGJEJ6UjhbGroSpAJ0CvZ896E4r7fo2emz8yLxKkemiyk8roG6wH DcpS07UG87ALy1uAhfnGpg1JhkvSRvrlgizZyOBhRqMc94WSiXIOysrxYKR1ucId /43FsIs+LAhm4bvLtltK/ImXBzkupCHGxGoUZVn3m+e5vXU5wx0Rl/vu+usBDSzL yTe1yGxxyeWM9GvS34Df3k61BiRN0KY/C/g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvvddthedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeeg fffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohephedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepjhhirg hnrdhunhhivhgvrhhsrghlihhthiesghhmrghilhdrtghomhdprhgtphhtthhopegtohhr vgihrdhhuhhinhhkvghrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepthhomhgrshesvh honhgurhgrrdhmvgdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhs rdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehtghhlsehsshhsrdhpghhhrd hprgdruhhs X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Nov 2025 00:39:23 -0500 (EST) Date: Tue, 18 Nov 2025 14:39:04 +0900 From: Michael Paquier To: jian he Cc: Corey Huinker , Tomas Vondra , pgsql-hackers@lists.postgresql.org, tgl@sss.pgh.pa.us Subject: Re: Extended Statistics set/restore/clear functions. Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="CNVCssQdYHpxU7aZ" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --CNVCssQdYHpxU7aZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 18, 2025 at 01:07:23PM +0800, jian he wrote: > + errsave(parse->escontext, > + errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), > + errmsg("malformed pg_ndistinct: \"%s\"", parse->str), > + errdetail("Invalid \"%s\" value.", > + PG_NDISTINCT_KEY_NDISTINCT)); >=20 > the errdetail is way too generic? > similar to ``select 'a'::int;`` > we can > DETAIL: Invalid input syntax for type integer: "a" > HINT: "ndistinct" value expected to be a type of integer. >=20 > what do you think? That is intentional, as it is intentional to not show the value of the token in such cases. This will be mostly used for the import functions, so I am not sure that it is worth spending time on tuning all these error cases that one is most likely not going to see as the main scenarios are going to be through pg_dump/restore, most of the time in the scope of an upgrade. > SELECT '[{"attributes" : [2,3], "ndistinct" : 4, "ndistinct" : > 14}]'::pg_ndistinct; > pg_ndistinct > ------------------------------------------- > [{"attributes": [2, 3], "ndistinct": 14}] >=20 > SELECT '[{"attributes" : [2,3], "ndistinct" : 4, "attributes" : > []}]'::pg_ndistinct; > pg_ndistinct > ------------------------------------------ > [{"attributes": [2, 3], "ndistinct": 4}] >=20 > Is the above output what we expected? Interesting one. The extra "attributes" should not be required once we have one set, indeed. -- Michael --CNVCssQdYHpxU7aZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmkcBngACgkQnvQgOdby QH21TA//cEuj6loqnc3BqMxP73uv44v5A6JEslgThsVQhtR9jD7EDohNO4BoP3Ak ARrgFlgu+lWcK6zkO30+espfPcH/V59DJERnOl0fZNy49PbribLHBTDBo9dEwTRQ CCcW5ZYB2XPYvrZNbVwJRL2AX+tJcoVwye8T1l/c9ya7lGkLld3/xH65bUfD9QVj 1ZBfpW9gPQNVBPq+dqFfjCaYBv7w75U6ksnfrQ+r7JpyyahaB/0hi5JQMhI4h0Md PuxQbMh0bL+RZuwGBn2t3GRK3U32v/garD1JY5l1TK7t4q+HkTAzsTBYAaZ6wimM o+c01t/SINKOdZGM51rR/EjUuA5GXPOPkoe7TpXhB1ft82GlC0IqCqBAWjpYs6G2 dw65aSxdjXfRRMbr5hjRxRXezUh2mQkGrxk7dooSoLGrbRDuN/XPeWqlJd9n8Ue3 sa9cg7RKw4jJNPnvMKSmhv2rw+jiNwyhHze0Mht40QQKivDqBFTIkQ0D9L1r5Vek pII+7UyA7uzDRehsN4PaacYdAWXKkag1WYV5rbgIooG/2H04txR2Q1p0PHgVgZnQ TzyxCckncOPv1w4D2Q53ux+7XCqD9gZJOExahR8gvmfBDshiPqVBqRcBpA9arHRA iQwMCEYZMtbQrdo3MR8laNgDml3UjpNUlUlUyK4uNmlFzO1/kok= =U8UV -----END PGP SIGNATURE----- --CNVCssQdYHpxU7aZ--