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 1vRKUA-00BHEP-1L for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Dec 2025 01:19:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vRKU8-0061sH-0H for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Dec 2025 01:19:48 +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 1vRKU7-0061s8-1K for pgsql-hackers@lists.postgresql.org; Fri, 05 Dec 2025 01:19:48 +0000 Received: from fhigh-b5-smtp.messagingengine.com ([202.12.124.156]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vRKU3-003C9Z-1q for pgsql-hackers@lists.postgresql.org; Fri, 05 Dec 2025 01:19:46 +0000 Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfhigh.stl.internal (Postfix) with ESMTP id 40CED7A001D; Thu, 4 Dec 2025 20:19:43 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Thu, 04 Dec 2025 20:19:43 -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=fm1; t=1764897583; x=1764983983; bh=BoGyP8iF10 rfewbpUU9H2GrbuqosbNr3MI6KrMshFVA=; b=UuDbK16KuxDYSsFCMDr544jnyg lTh+Wveci8fnhCZH5fUVBHoXl9cb4GINi7tTGUVzACpm9BqDv401GhjlTS1tGetL +K6tuxJ1Hudl0DJ1O8EBSlnLdQK808aLIqp7rM1qa6HNDkuU7v5BSDEJklH/Lulw 7v7qEFFh237t8bXnAGIgbfscBRqslgDyPlFeTbz2SXD26KdTq4LgkrmVUKjsVrrs nfsJyOWXFnX6/Fp34j5D19++xOHs2i3STtRr21CQpZGHl1oIqc/6lTyJ0FYfG3Uw NUApQmLcGDi6fK0blLdYjCzZjJjWLMPOTcO4fVJGrkL0XR5PqggnvzAYq9SQ== 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=fm1; t= 1764897583; x=1764983983; bh=BoGyP8iF10rfewbpUU9H2GrbuqosbNr3MI6 KrMshFVA=; b=Lqqal2XizMMPcOiHUxIkfD6PBODEND18v7k/TqRTLGpGuyBVlCA 8J6483QLR3jXkAQJ6T6TTPrUY6W6ZKEknMpk9Xfjlwt4J2XrTBbZU5eBE00JGREy rvUHasYZnWBGVyl/BIiuLuRrha5Ry3/y+jtWPfb2HXZUlvz2YLZhMAkNUe777Q5x vImniwdiebQjRj1gpNIVY7KpEi8+Es8tmWmasxA9STsy/xTcOcAMsf9rkD/CJ2WS 2m1u07hLh9uUNwj7wYXFBdd43vF3uYurKolX7Gu/gXLlwFJAhLqwbva/Xrl5z2tQ LIgw1xAtazq+R4eZFhy2FeXpW+5MY1FTMlg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdejtdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhluc fvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecu hfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqhhuih gvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeegfffh keeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidpnhgs pghrtghpthhtohephedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepthhglhessh hsshdrphhghhdrphgrrdhushdprhgtphhtthhopegtohhrvgihrdhhuhhinhhkvghrsehg mhgrihhlrdgtohhmpdhrtghpthhtohepjhhirghnrdhunhhivhgvrhhsrghlihhthiesgh hmrghilhdrtghomhdprhgtphhtthhopehtohhmrghssehvohhnughrrgdrmhgvpdhrtghp thhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrd horhhg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 4 Dec 2025 20:19:39 -0500 (EST) Date: Fri, 5 Dec 2025 10:19:27 +0900 From: Michael Paquier To: Tom Lane Cc: Corey Huinker , jian he , Tomas Vondra , pgsql-hackers@lists.postgresql.org Subject: Re: Extended Statistics set/restore/clear functions. Message-ID: References: <1341064.1764895052@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="oiY38TQJDPuYWisM" Content-Disposition: inline In-Reply-To: <1341064.1764895052@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --oiY38TQJDPuYWisM Content-Type: multipart/mixed; boundary="jbxw88jyHphMA3ez" Content-Disposition: inline --jbxw88jyHphMA3ez Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 04, 2025 at 07:37:32PM -0500, Tom Lane wrote: > This of course arises because the source code is passing the address > of a local ErrorSaveContext variable to that macro. We don't have > any other instances of that coding pattern AFAICS, so I wonder if > that was really the most adapted way to do it. Looking at the > code, it seems to be turning around and stuffing a different error > message into a passed-in ErrorSaveContext, which feels a little > weird. Thanks for the report. Right. There are three instances of that in pg_dependencies.c, two in pg_ndistinct.c. I would not mind doing the attached to calm down these warnings, matching with the other areas of the code, that simply removes the macro and checks the state value directly. > Also, I don't think these errdetail messages meet our style > guidelines: >=20 > errdetail("Invalid \"%s\" value.", PG_DEPENDENCIES_KEY_ATTRIBUTES)); >=20 > They're supposed to be complete sentences. Yeah, I should have been more careful here. I have spent more time on all of these, and adjusted all the errdetails for pg_ndistinct.c and pg_dependencies.c to use full sentences. I am just grouping everything with the attached. They'd be better if handled separately, obviously. Comments? -- Michael --jbxw88jyHphMA3ez Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Improve-pg_dependencies.c-and-pg_ndistinct.c.patch" Content-Transfer-Encoding: quoted-printable =46rom bb8f5e97e7cc7c435cbf1ec5bc16f1d5a46cc9e1 Mon Sep 17 00:00:00 2001 =46rom: Michael Paquier Date: Fri, 5 Dec 2025 10:14:39 +0900 Subject: [PATCH] Improve pg_dependencies.c and pg_ndistinct.c --- src/backend/utils/adt/pg_dependencies.c | 42 ++-- src/backend/utils/adt/pg_ndistinct.c | 34 +-- src/test/regress/expected/pg_dependencies.out | 196 +++++++++--------- src/test/regress/expected/pg_ndistinct.out | 160 +++++++------- 4 files changed, 216 insertions(+), 216 deletions(-) diff --git a/src/backend/utils/adt/pg_dependencies.c b/src/backend/utils/ad= t/pg_dependencies.c index 56abb7441775..1552e03d1c1e 100644 --- a/src/backend/utils/adt/pg_dependencies.c +++ b/src/backend/utils/adt/pg_dependencies.c @@ -85,7 +85,7 @@ dependencies_object_start(void *state) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_dependencies: \"%s\"", parse->str), - errdetail("Expected an object key.")); + errdetail("A key was expected.")); break; =20 case DEPS_EXPECT_ATTNUM_LIST: @@ -127,7 +127,7 @@ dependencies_object_start(void *state) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_dependencies: \"%s\"", parse->str), - errdetail("Unexpected parse state: %d", (int) parse->state)); + errdetail("Unexpected parse state has been found: %d.", (int) parse->= state)); break; } =20 @@ -153,7 +153,7 @@ dependencies_object_end(void *state) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_dependencies: \"%s\"", parse->str), - errdetail("Unexpected parse state: %d", (int) parse->state)); + errdetail("Unexpected parse state has been found: %d.", (int) parse->s= tate)); return JSON_SEM_ACTION_FAILED; } =20 @@ -162,7 +162,7 @@ dependencies_object_end(void *state) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_dependencies: \"%s\"", parse->str), - errdetail("Item must contain \"%s\" key", + errdetail("Item must contain \"%s\" key.", PG_DEPENDENCIES_KEY_ATTRIBUTES)); return JSON_SEM_ACTION_FAILED; } @@ -226,7 +226,7 @@ dependencies_object_end(void *state) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_dependencies: \"%s\"", parse->str), - errdetail("Item \"%s\" value %d found in the \"%s\" list.", + errdetail("Item \"%s\" with value %d has been found in the \"%s\" lis= t.", PG_DEPENDENCIES_KEY_DEPENDENCY, parse->dependency, PG_DEPENDENCIES_KEY_ATTRIBUTES)); return JSON_SEM_ACTION_FAILED; @@ -274,7 +274,7 @@ dependencies_array_start(void *state) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_dependencies: \"%s\"", parse->str), - errdetail("Array found in unexpected place.")); + errdetail("Array has been found at an unexpected location.")); return JSON_SEM_ACTION_FAILED; } =20 @@ -329,7 +329,7 @@ dependencies_array_end(void *state) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_dependencies: \"%s\"", parse->str), - errdetail("Array found in unexpected place.")); + errdetail("Array has been found at an unexpected location.")); break; } return JSON_SEM_ACTION_FAILED; @@ -446,7 +446,7 @@ dependencies_array_element_start(void *state, bool isnu= ll) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_dependencies: \"%s\"", parse->str), - errdetail("Unexpected array element.")); + errdetail("Unexpected array element has been found.")); break; } =20 @@ -494,12 +494,12 @@ dependencies_scalar(void *state, char *token, JsonTok= enType tokentype) case DEPS_EXPECT_ATTNUM: attnum =3D pg_strtoint16_safe(token, (Node *) &escontext); =20 - if (SOFT_ERROR_OCCURRED(&escontext)) + if (escontext.error_occurred) { errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_dependencies: \"%s\"", parse->str), - errdetail("Invalid \"%s\" value.", PG_DEPENDENCIES_KEY_ATTRIBUTES)); + errdetail("Key \"%s\" has an incorrect value.", PG_DEPENDENCIES_KEY_= ATTRIBUTES)); return JSON_SEM_ACTION_FAILED; } =20 @@ -512,7 +512,7 @@ dependencies_scalar(void *state, char *token, JsonToken= Type tokentype) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_dependencies: \"%s\"", parse->str), - errdetail("Invalid \"%s\" element: %d.", + errdetail("Invalid \"%s\" element has been found: %d.", PG_DEPENDENCIES_KEY_ATTRIBUTES, attnum)); return JSON_SEM_ACTION_FAILED; } @@ -526,7 +526,7 @@ dependencies_scalar(void *state, char *token, JsonToken= Type tokentype) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_dependencies: \"%s\"", parse->str), - errdetail("Invalid \"%s\" element: %d cannot follow %d.", + errdetail("Invalid \"%s\" element has been found: %d cannot follow = %d.", PG_DEPENDENCIES_KEY_ATTRIBUTES, attnum, prev)); return JSON_SEM_ACTION_FAILED; } @@ -539,12 +539,12 @@ dependencies_scalar(void *state, char *token, JsonTok= enType tokentype) parse->dependency =3D (AttrNumber) pg_strtoint16_safe(token, (Node *) &escontext); =20 - if (SOFT_ERROR_OCCURRED(&escontext)) + if (escontext.error_occurred) { errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_dependencies: \"%s\"", parse->str), - errdetail("Invalid \"%s\" value.", PG_DEPENDENCIES_KEY_DEPENDENCY)); + errdetail("Key \"%s\" has an incorrect value.", PG_DEPENDENCIES_KEY_= DEPENDENCY)); return JSON_SEM_ACTION_FAILED; } =20 @@ -557,7 +557,7 @@ dependencies_scalar(void *state, char *token, JsonToken= Type tokentype) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_dependencies: \"%s\"", parse->str), - errdetail("Invalid \"%s\" value: %d.", + errdetail("Key \"%s\" has an incorrect value: %d.", PG_DEPENDENCIES_KEY_DEPENDENCY, parse->dependency)); return JSON_SEM_ACTION_FAILED; } @@ -569,12 +569,12 @@ dependencies_scalar(void *state, char *token, JsonTok= enType tokentype) parse->degree =3D float8in_internal(token, NULL, "double", token, (Node *) &escontext); =20 - if (SOFT_ERROR_OCCURRED(&escontext)) + if (escontext.error_occurred) { errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_dependencies: \"%s\"", parse->str), - errdetail("Invalid \"%s\" value.", PG_DEPENDENCIES_KEY_DEGREE)); + errdetail("Key \"%s\" has an incorrect value.", PG_DEPENDENCIES_KEY_= DEGREE)); return JSON_SEM_ACTION_FAILED; } =20 @@ -585,7 +585,7 @@ dependencies_scalar(void *state, char *token, JsonToken= Type tokentype) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_dependencies: \"%s\"", parse->str), - errdetail("Unexpected scalar.")); + errdetail("Unexpected scalar has been found.")); break; } =20 @@ -686,7 +686,7 @@ build_mvdependencies(DependenciesParseState *parse, cha= r *str) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_dependencies: \"%s\"", str), - errdetail("Unexpected end state %d.", parse->state)); + errdetail("Unexpected end state has been found: %d.", parse->state)); return NULL; } =20 @@ -721,7 +721,7 @@ build_mvdependencies(DependenciesParseState *parse, cha= r *str) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_dependencies: \"%s\"", str), - errdetail("Duplicate \"%s\" array: [%s] with \"%s\": %d.", + errdetail("Duplicated \"%s\" array has been found: [%s] for key \"%s= \" and value %d.", PG_DEPENDENCIES_KEY_ATTRIBUTES, attnum_list, PG_DEPENDENCIES_KEY_DEPENDENCY, attnum_dep)); pfree(mvdeps); @@ -808,7 +808,7 @@ pg_dependencies_in(PG_FUNCTION_ARGS) errsave(parse_state.escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_dependencies: \"%s\"", str), - errdetail("Must be valid JSON.")); + errdetail("Input data must be valid JSON.")); =20 PG_RETURN_NULL(); } diff --git a/src/backend/utils/adt/pg_ndistinct.c b/src/backend/utils/adt/p= g_ndistinct.c index 5292521b1695..9bf1546c8030 100644 --- a/src/backend/utils/adt/pg_ndistinct.c +++ b/src/backend/utils/adt/pg_ndistinct.c @@ -81,7 +81,7 @@ ndistinct_object_start(void *state) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_ndistinct: \"%s\"", parse->str), - errdetail("Expected an object key.")); + errdetail("A key was expected.")); break; =20 case NDIST_EXPECT_ATTNUM_LIST: @@ -114,7 +114,7 @@ ndistinct_object_start(void *state) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_ndistinct: \"%s\"", parse->str), - errdetail("Unexpected parse state: %d", (int) parse->state)); + errdetail("Unexpected parse state has been found: %d.", (int) parse->= state)); break; } =20 @@ -140,7 +140,7 @@ ndistinct_object_end(void *state) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_ndistinct: \"%s\"", parse->str), - errdetail("Unexpected parse state: %d", (int) parse->state)); + errdetail("Unexpected parse state has been found: %d.", (int) parse->s= tate)); return JSON_SEM_ACTION_FAILED; } =20 @@ -228,7 +228,7 @@ ndistinct_array_start(void *state) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_ndistinct: \"%s\"", parse->str), - errdetail("Array found in unexpected place.")); + errdetail("Array has been found at an unexpected location.")); return JSON_SEM_ACTION_FAILED; } =20 @@ -289,7 +289,7 @@ ndistinct_array_end(void *state) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_ndistinct: \"%s\"", parse->str), - errdetail("Array found in unexpected place.")); + errdetail("Array has been found at an unexpected location.")); break; } =20 @@ -387,7 +387,7 @@ ndistinct_array_element_start(void *state, bool isnull) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_ndistinct: \"%s\"", parse->str), - errdetail("Unexpected array element.")); + errdetail("Unexpected array element has been found.")); break; } =20 @@ -435,12 +435,12 @@ ndistinct_scalar(void *state, char *token, JsonTokenT= ype tokentype) case NDIST_EXPECT_ATTNUM: attnum =3D pg_strtoint16_safe(token, (Node *) &escontext); =20 - if (SOFT_ERROR_OCCURRED(&escontext)) + if (escontext.error_occurred) { errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_ndistinct: \"%s\"", parse->str), - errdetail("Invalid \"%s\" value.", PG_NDISTINCT_KEY_ATTRIBUTES)); + errdetail("Key \"%s\" has an incorrect value.", PG_NDISTINCT_KEY_ATT= RIBUTES)); return JSON_SEM_ACTION_FAILED; } =20 @@ -453,7 +453,7 @@ ndistinct_scalar(void *state, char *token, JsonTokenTyp= e tokentype) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_ndistinct: \"%s\"", parse->str), - errdetail("Invalid \"%s\" element: %d.", + errdetail("Invalid \"%s\" element has been found: %d.", PG_NDISTINCT_KEY_ATTRIBUTES, attnum)); return JSON_SEM_ACTION_FAILED; } @@ -467,7 +467,7 @@ ndistinct_scalar(void *state, char *token, JsonTokenTyp= e tokentype) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_ndistinct: \"%s\"", parse->str), - errdetail("Invalid \"%s\" element: %d cannot follow %d.", + errdetail("Invalid \"%s\" element has been found: %d cannot follow = %d.", PG_NDISTINCT_KEY_ATTRIBUTES, attnum, prev)); return JSON_SEM_ACTION_FAILED; } @@ -485,7 +485,7 @@ ndistinct_scalar(void *state, char *token, JsonTokenTyp= e tokentype) */ parse->ndistinct =3D pg_strtoint32_safe(token, (Node *) &escontext); =20 - if (!SOFT_ERROR_OCCURRED(&escontext)) + if (!escontext.error_occurred) { parse->state =3D NDIST_EXPECT_KEY; return JSON_SUCCESS; @@ -494,7 +494,7 @@ ndistinct_scalar(void *state, char *token, JsonTokenTyp= e tokentype) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_ndistinct: \"%s\"", parse->str), - errdetail("Invalid \"%s\" value.", + errdetail("Key \"%s\" has an incorrect value.", PG_NDISTINCT_KEY_NDISTINCT)); break; =20 @@ -502,7 +502,7 @@ ndistinct_scalar(void *state, char *token, JsonTokenTyp= e tokentype) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_ndistinct: \"%s\"", parse->str), - errdetail("Unexpected scalar.")); + errdetail("Unexpected scalar has been found.")); break; } =20 @@ -627,7 +627,7 @@ build_mvndistinct(NDistinctParseState *parse, char *str) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_ndistinct: \"%s\"", str), - errdetail("Unexpected end state %d.", parse->state)); + errdetail("Unexpected end state has been found: %d.", parse->state)); return NULL; } =20 @@ -655,7 +655,7 @@ build_mvndistinct(NDistinctParseState *parse, char *str) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_ndistinct: \"%s\"", str), - errdetail("Duplicated \"%s\" array found: [%s]", + errdetail("Duplicated \"%s\" array has been found: [%s]", PG_NDISTINCT_KEY_ATTRIBUTES, s)); pfree(s); return NULL; @@ -705,7 +705,7 @@ build_mvndistinct(NDistinctParseState *parse, char *str) errsave(parse->escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_ndistinct: \"%s\"", str), - errdetail("\"%s\" array: [%s] must be a subset of array: [%s]", + errdetail("\"%s\" array [%s] must be a subset of array [%s].", PG_NDISTINCT_KEY_ATTRIBUTES, item_list, refitem_list)); pfree(item_list); @@ -784,7 +784,7 @@ pg_ndistinct_in(PG_FUNCTION_ARGS) errsave(parse_state.escontext, errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("malformed pg_ndistinct: \"%s\"", str), - errdetail("Must be valid JSON.")); + errdetail("Input data must be valid JSON.")); =20 PG_RETURN_NULL(); } diff --git a/src/test/regress/expected/pg_dependencies.out b/src/test/regre= ss/expected/pg_dependencies.out index 5c6fe6675173..04641f81d13f 100644 --- a/src/test/regress/expected/pg_dependencies.out +++ b/src/test/regress/expected/pg_dependencies.out @@ -4,7 +4,7 @@ SELECT 'null'::pg_dependencies; ERROR: malformed pg_dependencies: "null" LINE 1: SELECT 'null'::pg_dependencies; ^ -DETAIL: Unexpected scalar. +DETAIL: Unexpected scalar has been found. SELECT '{"a": 1}'::pg_dependencies; ERROR: malformed pg_dependencies: "{"a": 1}" LINE 1: SELECT '{"a": 1}'::pg_dependencies; @@ -26,9 +26,9 @@ LINE 1: SELECT '[null]'::pg_dependencies; ^ DETAIL: Item list elements cannot be null. SELECT * FROM pg_input_error_info('null', 'pg_dependencies'); - message | detail | hint | sql_error= _code=20 ------------------------------------+--------------------+------+----------= ------ - malformed pg_dependencies: "null" | Unexpected scalar. | | 22P02 + message | detail | h= int | sql_error_code=20 +-----------------------------------+-----------------------------------+--= ----+---------------- + malformed pg_dependencies: "null" | Unexpected scalar has been found. | = | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('{"a": 1}', 'pg_dependencies'); @@ -129,44 +129,44 @@ SELECT '[{"attributes" : ["\ud83d",3], "dependency" := 4, "degree": 0.250}]'::pg_ ERROR: malformed pg_dependencies: "[{"attributes" : ["\ud83d",3], "depend= ency" : 4, "degree": 0.250}]" LINE 1: SELECT '[{"attributes" : ["\ud83d",3], "dependency" : 4, "de... ^ -DETAIL: Must be valid JSON. +DETAIL: Input data must be valid JSON. SELECT '[{"attributes" : [2,3], "dependency" : "\ud83d", "degree": 0.250}]= '::pg_dependencies; ERROR: malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" := "\ud83d", "degree": 0.250}]" LINE 1: SELECT '[{"attributes" : [2,3], "dependency" : "\ud83d", "de... ^ -DETAIL: Must be valid JSON. +DETAIL: Input data must be valid JSON. SELECT '[{"attributes" : [2,3], "dependency" : 4, "degree": "\ud83d"}]'::p= g_dependencies; ERROR: malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" := 4, "degree": "\ud83d"}]" LINE 1: SELECT '[{"attributes" : [2,3], "dependency" : 4, "degree": ... ^ -DETAIL: Must be valid JSON. +DETAIL: Input data must be valid JSON. SELECT '[{"\ud83d" : [2,3], "dependency" : 4, "degree": 0.250}]'::pg_depen= dencies; ERROR: malformed pg_dependencies: "[{"\ud83d" : [2,3], "dependency" : 4, = "degree": 0.250}]" LINE 1: SELECT '[{"\ud83d" : [2,3], "dependency" : 4, "degree": 0.25... ^ -DETAIL: Must be valid JSON. +DETAIL: Input data must be valid JSON. SELECT * FROM pg_input_error_info('[{"attributes" : ["\ud83d",3], "depende= ncy" : 4, "degree": 0.250}]', 'pg_dependencies'); - message = | detail | hint | sql_error_code=20 ---------------------------------------------------------------------------= -----------------------+---------------------+------+---------------- - malformed pg_dependencies: "[{"attributes" : ["\ud83d",3], "dependency" := 4, "degree": 0.250}]" | Must be valid JSON. | | 22P02 + message = | detail | hint | sql_error_= code=20 +--------------------------------------------------------------------------= -----------------------+--------------------------------+------+-----------= ----- + malformed pg_dependencies: "[{"attributes" : ["\ud83d",3], "dependency" := 4, "degree": 0.250}]" | Input data must be valid JSON. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [2,3], "dependency" : = "\ud83d", "degree": 0.250}]', 'pg_dependencies'); - message = | detail | hint | sql_error_code=20 ---------------------------------------------------------------------------= -----------------------+---------------------+------+---------------- - malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" : "\ud83= d", "degree": 0.250}]" | Must be valid JSON. | | 22P02 + message = | detail | hint | sql_error_= code=20 +--------------------------------------------------------------------------= -----------------------+--------------------------------+------+-----------= ----- + malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" : "\ud83= d", "degree": 0.250}]" | Input data must be valid JSON. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [2,3], "dependency" : = 4, "degree": "\ud83d"}]', 'pg_dependencies'); - message = | detail | hint | sql_error_code=20 ---------------------------------------------------------------------------= -------------------+---------------------+------+---------------- - malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" : 4, "de= gree": "\ud83d"}]" | Must be valid JSON. | | 22P02 + message = | detail | hint | sql_error_code= =20 +--------------------------------------------------------------------------= -------------------+--------------------------------+------+---------------- + malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" : 4, "de= gree": "\ud83d"}]" | Input data must be valid JSON. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"\ud83d" : [2,3], "dependency" : 4, "= degree": 0.250}]', 'pg_dependencies'); - message = | detail | hint | sql_error_code=20 ---------------------------------------------------------------------------= ------------+---------------------+------+---------------- - malformed pg_dependencies: "[{"\ud83d" : [2,3], "dependency" : 4, "degree= ": 0.250}]" | Must be valid JSON. | | 22P02 + message = | detail | hint | sql_error_code=20 +--------------------------------------------------------------------------= ------------+--------------------------------+------+---------------- + malformed pg_dependencies: "[{"\ud83d" : [2,3], "dependency" : 4, "degree= ": 0.250}]" | Input data must be valid JSON. | | 22P02 (1 row) =20 -- Valid keys, invalid values @@ -174,7 +174,7 @@ SELECT '[{"attributes" : null, "dependency" : 4, "degre= e": 1.000}]'::pg_dependen ERROR: malformed pg_dependencies: "[{"attributes" : null, "dependency" : = 4, "degree": 1.000}]" LINE 1: SELECT '[{"attributes" : null, "dependency" : 4, "degree": 1... ^ -DETAIL: Unexpected scalar. +DETAIL: Unexpected scalar has been found. SELECT '[{"attributes" : [2,null], "dependency" : 4, "degree": 1.000}]'::p= g_dependencies; ERROR: malformed pg_dependencies: "[{"attributes" : [2,null], "dependency= " : 4, "degree": 1.000}]" LINE 1: SELECT '[{"attributes" : [2,null], "dependency" : 4, "degree... @@ -184,51 +184,51 @@ SELECT '[{"attributes" : [2,3], "dependency" : null, = "degree": 1.000}]'::pg_depe ERROR: malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" := null, "degree": 1.000}]" LINE 1: SELECT '[{"attributes" : [2,3], "dependency" : null, "degree... ^ -DETAIL: Invalid "dependency" value. +DETAIL: Key "dependency" has an incorrect value. SELECT '[{"attributes" : [2,"a"], "dependency" : 4, "degree": 1.000}]'::pg= _dependencies; ERROR: malformed pg_dependencies: "[{"attributes" : [2,"a"], "dependency"= : 4, "degree": 1.000}]" LINE 1: SELECT '[{"attributes" : [2,"a"], "dependency" : 4, "degree"... ^ -DETAIL: Invalid "attributes" value. +DETAIL: Key "attributes" has an incorrect value. SELECT '[{"attributes" : [2,3], "dependency" : "a", "degree": 1.000}]'::pg= _dependencies; ERROR: malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" := "a", "degree": 1.000}]" LINE 1: SELECT '[{"attributes" : [2,3], "dependency" : "a", "degree"... ^ -DETAIL: Invalid "dependency" value. +DETAIL: Key "dependency" has an incorrect value. SELECT '[{"attributes" : [2,3], "dependency" : [], "degree": 1.000}]'::pg_= dependencies; ERROR: malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" := [], "degree": 1.000}]" LINE 1: SELECT '[{"attributes" : [2,3], "dependency" : [], "degree":... ^ -DETAIL: Array found in unexpected place. +DETAIL: Array has been found at an unexpected location. SELECT '[{"attributes" : [2,3], "dependency" : [null], "degree": 1.000}]':= :pg_dependencies; ERROR: malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" := [null], "degree": 1.000}]" LINE 1: SELECT '[{"attributes" : [2,3], "dependency" : [null], "degr... ^ -DETAIL: Array found in unexpected place. +DETAIL: Array has been found at an unexpected location. SELECT '[{"attributes" : [2,3], "dependency" : [1,null], "degree": 1.000}]= '::pg_dependencies; ERROR: malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" := [1,null], "degree": 1.000}]" LINE 1: SELECT '[{"attributes" : [2,3], "dependency" : [1,null], "de... ^ -DETAIL: Array found in unexpected place. +DETAIL: Array has been found at an unexpected location. SELECT '[{"attributes" : 1, "dependency" : 4, "degree": 1.000}]'::pg_depen= dencies; ERROR: malformed pg_dependencies: "[{"attributes" : 1, "dependency" : 4, = "degree": 1.000}]" LINE 1: SELECT '[{"attributes" : 1, "dependency" : 4, "degree": 1.00... ^ -DETAIL: Unexpected scalar. +DETAIL: Unexpected scalar has been found. SELECT '[{"attributes" : "a", "dependency" : 4, "degree": 1.000}]'::pg_dep= endencies; ERROR: malformed pg_dependencies: "[{"attributes" : "a", "dependency" : 4= , "degree": 1.000}]" LINE 1: SELECT '[{"attributes" : "a", "dependency" : 4, "degree": 1.... ^ -DETAIL: Unexpected scalar. +DETAIL: Unexpected scalar has been found. SELECT '[{"attributes" : [2,3], "dependency" : 4, "degree": NaN}]'::pg_dep= endencies; ERROR: malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" := 4, "degree": NaN}]" LINE 1: SELECT '[{"attributes" : [2,3], "dependency" : 4, "degree": ... ^ -DETAIL: Must be valid JSON. +DETAIL: Input data must be valid JSON. SELECT * FROM pg_input_error_info('[{"attributes" : null, "dependency" : 4= , "degree": 1.000}]', 'pg_dependencies'); - message = | detail | hint | sql_error_code=20 ---------------------------------------------------------------------------= ---------------+--------------------+------+---------------- - malformed pg_dependencies: "[{"attributes" : null, "dependency" : 4, "deg= ree": 1.000}]" | Unexpected scalar. | | 22P02 + message = | detail | hint | sql_error_code= =20 +--------------------------------------------------------------------------= ---------------+-----------------------------------+------+---------------- + malformed pg_dependencies: "[{"attributes" : null, "dependency" : 4, "deg= ree": 1.000}]" | Unexpected scalar has been found. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [2,null], "dependency"= : 4, "degree": 1.000}]', 'pg_dependencies'); @@ -238,57 +238,57 @@ SELECT * FROM pg_input_error_info('[{"attributes" : [= 2,null], "dependency" : 4, (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [2,3], "dependency" : = null, "degree": 1.000}]', 'pg_dependencies'); - message = | detail | hint | sql_error_code=20 ---------------------------------------------------------------------------= -------------------+-----------------------------+------+---------------- - malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" : null, = "degree": 1.000}]" | Invalid "dependency" value. | | 22P02 + message = | detail | hint | sql_= error_code=20 +--------------------------------------------------------------------------= -------------------+------------------------------------------+------+-----= ----------- + malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" : null, = "degree": 1.000}]" | Key "dependency" has an incorrect value. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [2,"a"], "dependency" = : 4, "degree": 1.000}]', 'pg_dependencies'); - message = | detail | hint | sql_error_code=20 ---------------------------------------------------------------------------= ------------------+-----------------------------+------+---------------- - malformed pg_dependencies: "[{"attributes" : [2,"a"], "dependency" : 4, "= degree": 1.000}]" | Invalid "attributes" value. | | 22P02 + message = | detail | hint | sql_e= rror_code=20 +--------------------------------------------------------------------------= ------------------+------------------------------------------+------+------= ---------- + malformed pg_dependencies: "[{"attributes" : [2,"a"], "dependency" : 4, "= degree": 1.000}]" | Key "attributes" has an incorrect value. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [2,3], "dependency" : = "a", "degree": 1.000}]', 'pg_dependencies'); - message = | detail | hint | sql_error_code=20 ---------------------------------------------------------------------------= ------------------+-----------------------------+------+---------------- - malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" : "a", "= degree": 1.000}]" | Invalid "dependency" value. | | 22P02 + message = | detail | hint | sql_e= rror_code=20 +--------------------------------------------------------------------------= ------------------+------------------------------------------+------+------= ---------- + malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" : "a", "= degree": 1.000}]" | Key "dependency" has an incorrect value. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [2,3], "dependency" : = [], "degree": 1.000}]', 'pg_dependencies'); - message = | detail | hint | sql_error_code= =20 ---------------------------------------------------------------------------= -----------------+----------------------------------+------+---------------- - malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" : [], "d= egree": 1.000}]" | Array found in unexpected place. | | 22P02 + message = | detail | hint |= sql_error_code=20 +--------------------------------------------------------------------------= -----------------+-------------------------------------------------+------+= ---------------- + malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" : [], "d= egree": 1.000}]" | Array has been found at an unexpected location. | |= 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [2,3], "dependency" : = [null], "degree": 1.000}]', 'pg_dependencies'); - message = | detail | hint | sql_error_= code=20 ---------------------------------------------------------------------------= ---------------------+----------------------------------+------+-----------= ----- - malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" : [null]= , "degree": 1.000}]" | Array found in unexpected place. | | 22P02 + message = | detail | hi= nt | sql_error_code=20 +--------------------------------------------------------------------------= ---------------------+-------------------------------------------------+---= ---+---------------- + malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" : [null]= , "degree": 1.000}]" | Array has been found at an unexpected location. | = | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [2,3], "dependency" : = [1,null], "degree": 1.000}]', 'pg_dependencies'); - message = | detail | hint | sql_erro= r_code=20 ---------------------------------------------------------------------------= -----------------------+----------------------------------+------+---------= ------- - malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" : [1,nul= l], "degree": 1.000}]" | Array found in unexpected place. | | 22P02 + message = | detail | = hint | sql_error_code=20 +--------------------------------------------------------------------------= -----------------------+-------------------------------------------------+-= -----+---------------- + malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" : [1,nul= l], "degree": 1.000}]" | Array has been found at an unexpected location. | = | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : 1, "dependency" : 4, "= degree": 1.000}]', 'pg_dependencies'); - message = | detail | hint | sql_error_code=20 ---------------------------------------------------------------------------= ------------+--------------------+------+---------------- - malformed pg_dependencies: "[{"attributes" : 1, "dependency" : 4, "degree= ": 1.000}]" | Unexpected scalar. | | 22P02 + message = | detail | hint | sql_error_code=20 +--------------------------------------------------------------------------= ------------+-----------------------------------+------+---------------- + malformed pg_dependencies: "[{"attributes" : 1, "dependency" : 4, "degree= ": 1.000}]" | Unexpected scalar has been found. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : "a", "dependency" : 4,= "degree": 1.000}]', 'pg_dependencies'); - message = | detail | hint | sql_error_code=20 ---------------------------------------------------------------------------= --------------+--------------------+------+---------------- - malformed pg_dependencies: "[{"attributes" : "a", "dependency" : 4, "degr= ee": 1.000}]" | Unexpected scalar. | | 22P02 + message = | detail | hint | sql_error_code= =20 +--------------------------------------------------------------------------= --------------+-----------------------------------+------+---------------- + malformed pg_dependencies: "[{"attributes" : "a", "dependency" : 4, "degr= ee": 1.000}]" | Unexpected scalar has been found. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [2,3], "dependency" : = 4, "degree": NaN}]', 'pg_dependencies'); - message = | detail | hint | sql_error_code=20 ---------------------------------------------------------------------------= --------------+---------------------+------+---------------- - malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" : 4, "de= gree": NaN}]" | Must be valid JSON. | | 22P02 + message = | detail | hint | sql_error_code=20 +--------------------------------------------------------------------------= --------------+--------------------------------+------+---------------- + malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" : 4, "de= gree": NaN}]" | Input data must be valid JSON. | | 22P02 (1 row) =20 SELECT '[{"attributes": [], "dependency": 2, "degree": 1}]' ::pg_dependenc= ies; @@ -317,22 +317,22 @@ SELECT '[{"dependency" : 4, "degree": "1.2"}]'::pg_de= pendencies; ERROR: malformed pg_dependencies: "[{"dependency" : 4, "degree": "1.2"}]" LINE 1: SELECT '[{"dependency" : 4, "degree": "1.2"}]'::pg_dependenc... ^ -DETAIL: Item must contain "attributes" key +DETAIL: Item must contain "attributes" key. SELECT '[{"attributes" : [1,2,3,4,5,6,7], "dependency" : 0, "degree": "1.2= "}]'::pg_dependencies; ERROR: malformed pg_dependencies: "[{"attributes" : [1,2,3,4,5,6,7], "dep= endency" : 0, "degree": "1.2"}]" LINE 1: SELECT '[{"attributes" : [1,2,3,4,5,6,7], "dependency" : 0, ... ^ -DETAIL: Invalid "dependency" value: 0. +DETAIL: Key "dependency" has an incorrect value: 0. SELECT '[{"attributes" : [1,2,3,4,5,6,7], "dependency" : -9, "degree": "1.= 2"}]'::pg_dependencies; ERROR: malformed pg_dependencies: "[{"attributes" : [1,2,3,4,5,6,7], "dep= endency" : -9, "degree": "1.2"}]" LINE 1: SELECT '[{"attributes" : [1,2,3,4,5,6,7], "dependency" : -9,... ^ -DETAIL: Invalid "dependency" value: -9. +DETAIL: Key "dependency" has an incorrect value: -9. SELECT '[{"attributes": [1,2], "dependency": 2, "degree": 1}]' ::pg_depend= encies; ERROR: malformed pg_dependencies: "[{"attributes": [1,2], "dependency": 2= , "degree": 1}]" LINE 1: SELECT '[{"attributes": [1,2], "dependency": 2, "degree": 1}... ^ -DETAIL: Item "dependency" value 2 found in the "attributes" list. +DETAIL: Item "dependency" with value 2 has been found in the "attributes"= list. SELECT '[{"attributes" : [1, {}], "dependency" : 1, "degree": "1.2"}]'::pg= _dependencies; ERROR: malformed pg_dependencies: "[{"attributes" : [1, {}], "dependency"= : 1, "degree": "1.2"}]" LINE 1: SELECT '[{"attributes" : [1, {}], "dependency" : 1, "degree"... @@ -352,29 +352,29 @@ SELECT '[{"attributes" : [1,2], "dependency" : 1, "de= gree": "a"}]'::pg_dependenc ERROR: malformed pg_dependencies: "[{"attributes" : [1,2], "dependency" := 1, "degree": "a"}]" LINE 1: SELECT '[{"attributes" : [1,2], "dependency" : 1, "degree": ... ^ -DETAIL: Invalid "degree" value. +DETAIL: Key "degree" has an incorrect value. SELECT * FROM pg_input_error_info('[{"dependency" : 4, "degree": "1.2"}]',= 'pg_dependencies'); - message | = detail | hint | sql_error_code=20 ---------------------------------------------------------------------+-----= -------------------------------+------+---------------- - malformed pg_dependencies: "[{"dependency" : 4, "degree": "1.2"}]" | Item= must contain "attributes" key | | 22P02 + message | = detail | hint | sql_error_code=20 +--------------------------------------------------------------------+-----= --------------------------------+------+---------------- + malformed pg_dependencies: "[{"dependency" : 4, "degree": "1.2"}]" | Item= must contain "attributes" key. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [1,2,3,4,5,6,7], "depe= ndency" : 0, "degree": "1.2"}]', 'pg_dependencies'); - message = | detail | hint | sql_err= or_code=20 ---------------------------------------------------------------------------= --------------------------+--------------------------------+------+--------= -------- - malformed pg_dependencies: "[{"attributes" : [1,2,3,4,5,6,7], "dependency= " : 0, "degree": "1.2"}]" | Invalid "dependency" value: 0. | | 22P02 + message = | detail | h= int | sql_error_code=20 +--------------------------------------------------------------------------= --------------------------+---------------------------------------------+--= ----+---------------- + malformed pg_dependencies: "[{"attributes" : [1,2,3,4,5,6,7], "dependency= " : 0, "degree": "1.2"}]" | Key "dependency" has an incorrect value: 0. | = | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [1,2,3,4,5,6,7], "depe= ndency" : -9, "degree": "1.2"}]', 'pg_dependencies'); - message = | detail | hint | sql_e= rror_code=20 ---------------------------------------------------------------------------= ---------------------------+---------------------------------+------+------= ---------- - malformed pg_dependencies: "[{"attributes" : [1,2,3,4,5,6,7], "dependency= " : -9, "degree": "1.2"}]" | Invalid "dependency" value: -9. | | 22P02 + message = | detail |= hint | sql_error_code=20 +--------------------------------------------------------------------------= ---------------------------+----------------------------------------------+= ------+---------------- + malformed pg_dependencies: "[{"attributes" : [1,2,3,4,5,6,7], "dependency= " : -9, "degree": "1.2"}]" | Key "dependency" has an incorrect value: -9. |= | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes": [1,2], "dependency": 2,= "degree": 1}]' , 'pg_dependencies'); - message = | detail | hin= t | sql_error_code=20 ---------------------------------------------------------------------------= ----------+-----------------------------------------------------------+----= --+---------------- - malformed pg_dependencies: "[{"attributes": [1,2], "dependency": 2, "degr= ee": 1}]" | Item "dependency" value 2 found in the "attributes" list. | = | 22P02 + message = | detail = | hint | sql_error_code=20 +--------------------------------------------------------------------------= ----------+----------------------------------------------------------------= ---------+------+---------------- + malformed pg_dependencies: "[{"attributes": [1,2], "dependency": 2, "degr= ee": 1}]" | Item "dependency" with value 2 has been found in the "attribute= s" list. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [1, {}], "dependency" = : 1, "degree": "1.2"}]', 'pg_dependencies'); @@ -396,9 +396,9 @@ SELECT * FROM pg_input_error_info('[{"attributes" : [1,= 2], "dependency" : 3, "de (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [1,2], "dependency" : = 1, "degree": "a"}]', 'pg_dependencies'); - message = | detail | hint | sql_error_code=20 ---------------------------------------------------------------------------= --------------+-------------------------+------+---------------- - malformed pg_dependencies: "[{"attributes" : [1,2], "dependency" : 1, "de= gree": "a"}]" | Invalid "degree" value. | | 22P02 + message = | detail | hint | sql_error_cod= e=20 +--------------------------------------------------------------------------= --------------+--------------------------------------+------+--------------= -- + malformed pg_dependencies: "[{"attributes" : [1,2], "dependency" : 1, "de= gree": "a"}]" | Key "degree" has an incorrect value. | | 22P02 (1 row) =20 -- Funky degree values, which do not fail. @@ -422,7 +422,7 @@ SELECT '[{"attributes" : [2], "dependency" : 4, "degree= ": "inf"}]'::pg_dependenc =20 SELECT '[{"attributes" : [2], "dependency" : 4, "degree": "-inf"}]'::pg_de= pendencies::text::pg_dependencies; ERROR: malformed pg_dependencies: "[{"attributes": [2], "dependency": 4, = "degree": -Infinity}]" -DETAIL: Must be valid JSON. +DETAIL: Input data must be valid JSON. -- Duplicated keys SELECT '[{"attributes" : [2,3], "attributes": [1,2], "dependency" : 4, "de= gree": 1.000}]'::pg_dependencies; ERROR: malformed pg_dependencies: "[{"attributes" : [2,3], "attributes": = [1,2], "dependency" : 4, "degree": 1.000}]" @@ -462,22 +462,22 @@ SELECT '[{"attributes" : [0,2], "dependency" : 4, "de= gree": 0.500}]'::pg_depende ERROR: malformed pg_dependencies: "[{"attributes" : [0,2], "dependency" := 4, "degree": 0.500}]" LINE 1: SELECT '[{"attributes" : [0,2], "dependency" : 4, "degree": ... ^ -DETAIL: Invalid "attributes" element: 0. +DETAIL: Invalid "attributes" element has been found: 0. SELECT '[{"attributes" : [-7,-9], "dependency" : 4, "degree": 0.500}]'::pg= _dependencies; ERROR: malformed pg_dependencies: "[{"attributes" : [-7,-9], "dependency"= : 4, "degree": 0.500}]" LINE 1: SELECT '[{"attributes" : [-7,-9], "dependency" : 4, "degree"... ^ -DETAIL: Invalid "attributes" element: -9. +DETAIL: Invalid "attributes" element has been found: -9. SELECT * FROM pg_input_error_info('[{"attributes" : [0,2], "dependency" : = 4, "degree": 0.500}]', 'pg_dependencies'); - message = | detail | hint | sql_error_code= =20 ---------------------------------------------------------------------------= ----------------+----------------------------------+------+---------------- - malformed pg_dependencies: "[{"attributes" : [0,2], "dependency" : 4, "de= gree": 0.500}]" | Invalid "attributes" element: 0. | | 22P02 + message = | detail | hint | = sql_error_code=20 +--------------------------------------------------------------------------= ----------------+-------------------------------------------------+------+-= --------------- + malformed pg_dependencies: "[{"attributes" : [0,2], "dependency" : 4, "de= gree": 0.500}]" | Invalid "attributes" element has been found: 0. | | = 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [-7,-9], "dependency" = : 4, "degree": 0.500}]', 'pg_dependencies'); - message = | detail | hint | sql_error_co= de=20 ---------------------------------------------------------------------------= ------------------+-----------------------------------+------+-------------= --- - malformed pg_dependencies: "[{"attributes" : [-7,-9], "dependency" : 4, "= degree": 0.500}]" | Invalid "attributes" element: -9. | | 22P02 + message = | detail | hint= | sql_error_code=20 +--------------------------------------------------------------------------= ------------------+--------------------------------------------------+-----= -+---------------- + malformed pg_dependencies: "[{"attributes" : [-7,-9], "dependency" : 4, "= degree": 0.500}]" | Invalid "attributes" element has been found: -9. | = | 22P02 (1 row) =20 -- Duplicated attributes @@ -485,11 +485,11 @@ SELECT '[{"attributes" : [2,2], "dependency" : 4, "de= gree": 0.500}]'::pg_depende ERROR: malformed pg_dependencies: "[{"attributes" : [2,2], "dependency" := 4, "degree": 0.500}]" LINE 1: SELECT '[{"attributes" : [2,2], "dependency" : 4, "degree": ... ^ -DETAIL: Invalid "attributes" element: 2 cannot follow 2. +DETAIL: Invalid "attributes" element has been found: 2 cannot follow 2. SELECT * FROM pg_input_error_info('[{"attributes" : [2,2], "dependency" : = 4, "degree": 0.500}]', 'pg_dependencies'); - message = | detail | hint |= sql_error_code=20 ---------------------------------------------------------------------------= ----------------+--------------------------------------------------+------+= ---------------- - malformed pg_dependencies: "[{"attributes" : [2,2], "dependency" : 4, "de= gree": 0.500}]" | Invalid "attributes" element: 2 cannot follow 2. | |= 22P02 + message = | detail = | hint | sql_error_code=20 +--------------------------------------------------------------------------= ----------------+----------------------------------------------------------= -------+------+---------------- + malformed pg_dependencies: "[{"attributes" : [2,2], "dependency" : 4, "de= gree": 0.500}]" | Invalid "attributes" element has been found: 2 cannot fol= low 2. | | 22P02 (1 row) =20 -- Duplicated attribute lists. @@ -499,13 +499,13 @@ ERROR: malformed pg_dependencies: "[{"attributes" : = [2,3], "dependency" : 4, "d {"attributes" : [2,3], "dependency" : 4, "degree": 1.000}]" LINE 1: SELECT '[{"attributes" : [2,3], "dependency" : 4, "degree": ... ^ -DETAIL: Duplicate "attributes" array: [2, 3] with "dependency": 4. +DETAIL: Duplicated "attributes" array has been found: [2, 3] for key "dep= endency" and value 4. SELECT * FROM pg_input_error_info('[{"attributes" : [2,3], "dependency" : = 4, "degree": 1.000}, {"attributes" : [2,3], "dependency" : 4, "degree": 1.000}]', 'pg_= dependencies'); - message = | detail = | hint | sql_error_code=20 ---------------------------------------------------------------------------= ---------------+-----------------------------------------------------------= -+------+---------------- - malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" : 4, "de= gree": 1.000},+| Duplicate "attributes" array: [2, 3] with "dependency": 4.= | | 22P02 - {"attributes" : [2,3], "dependency" : 4, "degree": 1.000}]" = | = | |=20 + message = | detail = | hint | sql_error_code=20 +--------------------------------------------------------------------------= ---------------+-----------------------------------------------------------= -----------------------------+------+---------------- + malformed pg_dependencies: "[{"attributes" : [2,3], "dependency" : 4, "de= gree": 1.000},+| Duplicated "attributes" array has been found: [2, 3] for k= ey "dependency" and value 4. | | 22P02 + {"attributes" : [2,3], "dependency" : 4, "degree": 1.000}]" = | = | |=20 (1 row) =20 -- Valid inputs diff --git a/src/test/regress/expected/pg_ndistinct.out b/src/test/regress/= expected/pg_ndistinct.out index 736954b9301c..e03cacd25c24 100644 --- a/src/test/regress/expected/pg_ndistinct.out +++ b/src/test/regress/expected/pg_ndistinct.out @@ -4,7 +4,7 @@ SELECT 'null'::pg_ndistinct; ERROR: malformed pg_ndistinct: "null" LINE 1: SELECT 'null'::pg_ndistinct; ^ -DETAIL: Unexpected scalar. +DETAIL: Unexpected scalar has been found. SELECT '{"a": 1}'::pg_ndistinct; ERROR: malformed pg_ndistinct: "{"a": 1}" LINE 1: SELECT '{"a": 1}'::pg_ndistinct; @@ -26,9 +26,9 @@ LINE 1: SELECT '[null]'::pg_ndistinct; ^ DETAIL: Item list elements cannot be null. SELECT * FROM pg_input_error_info('null', 'pg_ndistinct'); - message | detail | hint | sql_error_co= de=20 ---------------------------------+--------------------+------+-------------= --- - malformed pg_ndistinct: "null" | Unexpected scalar. | | 22P02 + message | detail | hint= | sql_error_code=20 +--------------------------------+-----------------------------------+-----= -+---------------- + malformed pg_ndistinct: "null" | Unexpected scalar has been found. | = | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('{"a": 1}', 'pg_ndistinct'); @@ -140,44 +140,44 @@ SELECT '[{"\ud83d" : [1, 2], "ndistinct" : 4}]'::pg_n= distinct; ERROR: malformed pg_ndistinct: "[{"\ud83d" : [1, 2], "ndistinct" : 4}]" LINE 1: SELECT '[{"\ud83d" : [1, 2], "ndistinct" : 4}]'::pg_ndistinc... ^ -DETAIL: Must be valid JSON. +DETAIL: Input data must be valid JSON. SELECT '[{"attributes" : [1, 2], "\ud83d" : 4}]'::pg_ndistinct; ERROR: malformed pg_ndistinct: "[{"attributes" : [1, 2], "\ud83d" : 4}]" LINE 1: SELECT '[{"attributes" : [1, 2], "\ud83d" : 4}]'::pg_ndistin... ^ -DETAIL: Must be valid JSON. +DETAIL: Input data must be valid JSON. SELECT '[{"attributes" : [1, 2], "ndistinct" : "\ud83d"}]'::pg_ndistinct; ERROR: malformed pg_ndistinct: "[{"attributes" : [1, 2], "ndistinct" : "\= ud83d"}]" LINE 1: SELECT '[{"attributes" : [1, 2], "ndistinct" : "\ud83d"}]'::... ^ -DETAIL: Must be valid JSON. +DETAIL: Input data must be valid JSON. SELECT '[{"attributes" : ["\ud83d", 2], "ndistinct" : 1}]'::pg_ndistinct; ERROR: malformed pg_ndistinct: "[{"attributes" : ["\ud83d", 2], "ndistinc= t" : 1}]" LINE 1: SELECT '[{"attributes" : ["\ud83d", 2], "ndistinct" : 1}]'::... ^ -DETAIL: Must be valid JSON. +DETAIL: Input data must be valid JSON. SELECT * FROM pg_input_error_info('[{"\ud83d" : [1, 2], "ndistinct" : 4}]'= , 'pg_ndistinct'); - message | = detail | hint | sql_error_code=20 -------------------------------------------------------------------+-------= --------------+------+---------------- - malformed pg_ndistinct: "[{"\ud83d" : [1, 2], "ndistinct" : 4}]" | Must b= e valid JSON. | | 22P02 + message | = detail | hint | sql_error_code=20 +------------------------------------------------------------------+-------= -------------------------+------+---------------- + malformed pg_ndistinct: "[{"\ud83d" : [1, 2], "ndistinct" : 4}]" | Input = data must be valid JSON. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [1, 2], "\ud83d" : 4}]= ', 'pg_ndistinct'); - message | = detail | hint | sql_error_code=20 --------------------------------------------------------------------+------= ---------------+------+---------------- - malformed pg_ndistinct: "[{"attributes" : [1, 2], "\ud83d" : 4}]" | Must = be valid JSON. | | 22P02 + message | = detail | hint | sql_error_code=20 +-------------------------------------------------------------------+------= --------------------------+------+---------------- + malformed pg_ndistinct: "[{"attributes" : [1, 2], "\ud83d" : 4}]" | Input= data must be valid JSON. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [1, 2], "ndistinct" : = "\ud83d"}]', 'pg_ndistinct'); - message = | detail | hint | sql_error_code=20 ---------------------------------------------------------------------------= ---+---------------------+------+---------------- - malformed pg_ndistinct: "[{"attributes" : [1, 2], "ndistinct" : "\ud83d"}= ]" | Must be valid JSON. | | 22P02 + message = | detail | hint | sql_error_code=20 +--------------------------------------------------------------------------= ---+--------------------------------+------+---------------- + malformed pg_ndistinct: "[{"attributes" : [1, 2], "ndistinct" : "\ud83d"}= ]" | Input data must be valid JSON. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : ["\ud83d", 2], "ndisti= nct" : 1}]', 'pg_ndistinct'); - message = | detail | hint | sql_error_code=20 ---------------------------------------------------------------------------= ---+---------------------+------+---------------- - malformed pg_ndistinct: "[{"attributes" : ["\ud83d", 2], "ndistinct" : 1}= ]" | Must be valid JSON. | | 22P02 + message = | detail | hint | sql_error_code=20 +--------------------------------------------------------------------------= ---+--------------------------------+------+---------------- + malformed pg_ndistinct: "[{"attributes" : ["\ud83d", 2], "ndistinct" : 1}= ]" | Input data must be valid JSON. | | 22P02 (1 row) =20 -- Valid keys, invalid values @@ -185,7 +185,7 @@ SELECT '[{"attributes" : null, "ndistinct" : 4}]'::pg_n= distinct; ERROR: malformed pg_ndistinct: "[{"attributes" : null, "ndistinct" : 4}]" LINE 1: SELECT '[{"attributes" : null, "ndistinct" : 4}]'::pg_ndisti... ^ -DETAIL: Unexpected scalar. +DETAIL: Unexpected scalar has been found. SELECT '[{"attributes" : [], "ndistinct" : 1}]'::pg_ndistinct; ERROR: malformed pg_ndistinct: "[{"attributes" : [], "ndistinct" : 1}]" LINE 1: SELECT '[{"attributes" : [], "ndistinct" : 1}]'::pg_ndistinc... @@ -205,32 +205,32 @@ SELECT '[{"attributes" : [2,3], "ndistinct" : null}]'= ::pg_ndistinct; ERROR: malformed pg_ndistinct: "[{"attributes" : [2,3], "ndistinct" : nul= l}]" LINE 1: SELECT '[{"attributes" : [2,3], "ndistinct" : null}]'::pg_nd... ^ -DETAIL: Invalid "ndistinct" value. +DETAIL: Key "ndistinct" has an incorrect value. SELECT '[{"attributes" : [2,"a"], "ndistinct" : 4}]'::pg_ndistinct; ERROR: malformed pg_ndistinct: "[{"attributes" : [2,"a"], "ndistinct" : 4= }]" LINE 1: SELECT '[{"attributes" : [2,"a"], "ndistinct" : 4}]'::pg_ndi... ^ -DETAIL: Invalid "attributes" value. +DETAIL: Key "attributes" has an incorrect value. SELECT '[{"attributes" : [2,3], "ndistinct" : "a"}]'::pg_ndistinct; ERROR: malformed pg_ndistinct: "[{"attributes" : [2,3], "ndistinct" : "a"= }]" LINE 1: SELECT '[{"attributes" : [2,3], "ndistinct" : "a"}]'::pg_ndi... ^ -DETAIL: Invalid "ndistinct" value. +DETAIL: Key "ndistinct" has an incorrect value. SELECT '[{"attributes" : [2,3], "ndistinct" : []}]'::pg_ndistinct; ERROR: malformed pg_ndistinct: "[{"attributes" : [2,3], "ndistinct" : []}= ]" LINE 1: SELECT '[{"attributes" : [2,3], "ndistinct" : []}]'::pg_ndis... ^ -DETAIL: Array found in unexpected place. +DETAIL: Array has been found at an unexpected location. SELECT '[{"attributes" : [2,3], "ndistinct" : [null]}]'::pg_ndistinct; ERROR: malformed pg_ndistinct: "[{"attributes" : [2,3], "ndistinct" : [nu= ll]}]" LINE 1: SELECT '[{"attributes" : [2,3], "ndistinct" : [null]}]'::pg_... ^ -DETAIL: Array found in unexpected place. +DETAIL: Array has been found at an unexpected location. SELECT '[{"attributes" : [2,3], "ndistinct" : [1,null]}]'::pg_ndistinct; ERROR: malformed pg_ndistinct: "[{"attributes" : [2,3], "ndistinct" : [1,= null]}]" LINE 1: SELECT '[{"attributes" : [2,3], "ndistinct" : [1,null]}]'::p... ^ -DETAIL: Array found in unexpected place. +DETAIL: Array has been found at an unexpected location. SELECT '[{"attributes" : [2,3], "ndistinct" : {"a": 1}}]'::pg_ndistinct; ERROR: malformed pg_ndistinct: "[{"attributes" : [2,3], "ndistinct" : {"a= ": 1}}]" LINE 1: SELECT '[{"attributes" : [2,3], "ndistinct" : {"a": 1}}]'::p... @@ -240,22 +240,22 @@ SELECT '[{"attributes" : [0,1], "ndistinct" : 1}]'::p= g_ndistinct; ERROR: malformed pg_ndistinct: "[{"attributes" : [0,1], "ndistinct" : 1}]" LINE 1: SELECT '[{"attributes" : [0,1], "ndistinct" : 1}]'::pg_ndist... ^ -DETAIL: Invalid "attributes" element: 0. +DETAIL: Invalid "attributes" element has been found: 0. SELECT '[{"attributes" : [-7,-9], "ndistinct" : 1}]'::pg_ndistinct; ERROR: malformed pg_ndistinct: "[{"attributes" : [-7,-9], "ndistinct" : 1= }]" LINE 1: SELECT '[{"attributes" : [-7,-9], "ndistinct" : 1}]'::pg_ndi... ^ -DETAIL: Invalid "attributes" element: -9. +DETAIL: Invalid "attributes" element has been found: -9. SELECT '[{"attributes" : 1, "ndistinct" : 4}]'::pg_ndistinct; ERROR: malformed pg_ndistinct: "[{"attributes" : 1, "ndistinct" : 4}]" LINE 1: SELECT '[{"attributes" : 1, "ndistinct" : 4}]'::pg_ndistinct... ^ -DETAIL: Unexpected scalar. +DETAIL: Unexpected scalar has been found. SELECT '[{"attributes" : "a", "ndistinct" : 4}]'::pg_ndistinct; ERROR: malformed pg_ndistinct: "[{"attributes" : "a", "ndistinct" : 4}]" LINE 1: SELECT '[{"attributes" : "a", "ndistinct" : 4}]'::pg_ndistin... ^ -DETAIL: Unexpected scalar. +DETAIL: Unexpected scalar has been found. SELECT '[{"attributes" : {"a": 1}, "ndistinct" : 1}]'::pg_ndistinct; ERROR: malformed pg_ndistinct: "[{"attributes" : {"a": 1}, "ndistinct" : = 1}]" LINE 1: SELECT '[{"attributes" : {"a": 1}, "ndistinct" : 1}]'::pg_nd... @@ -267,9 +267,9 @@ LINE 1: SELECT '[{"attributes" : [1, {"a": 1}], "ndisti= nct" : 1}]'::... ^ DETAIL: Attribute lists can only contain attribute numbers. SELECT * FROM pg_input_error_info('[{"attributes" : null, "ndistinct" : 4}= ]', 'pg_ndistinct'); - message | = detail | hint | sql_error_code=20 ---------------------------------------------------------------------+-----= ---------------+------+---------------- - malformed pg_ndistinct: "[{"attributes" : null, "ndistinct" : 4}]" | Unex= pected scalar. | | 22P02 + message | = detail | hint | sql_error_code=20 +--------------------------------------------------------------------+-----= ------------------------------+------+---------------- + malformed pg_ndistinct: "[{"attributes" : null, "ndistinct" : 4}]" | Unex= pected scalar has been found. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [], "ndistinct" : 1}]'= , 'pg_ndistinct'); @@ -291,39 +291,39 @@ SELECT * FROM pg_input_error_info('[{"attributes" : [= 2,null], "ndistinct" : 4}]' (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [2,3], "ndistinct" : n= ull}]', 'pg_ndistinct'); - message | = detail | hint | sql_error_code=20 -------------------------------------------------------------------------+-= ---------------------------+------+---------------- - malformed pg_ndistinct: "[{"attributes" : [2,3], "ndistinct" : null}]" | = Invalid "ndistinct" value. | | 22P02 + message | = detail | hint | sql_error_code=20 +------------------------------------------------------------------------+-= ----------------------------------------+------+---------------- + malformed pg_ndistinct: "[{"attributes" : [2,3], "ndistinct" : null}]" | = Key "ndistinct" has an incorrect value. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [2,"a"], "ndistinct" := 4}]', 'pg_ndistinct'); - message | = detail | hint | sql_error_code=20 ------------------------------------------------------------------------+--= ---------------------------+------+---------------- - malformed pg_ndistinct: "[{"attributes" : [2,"a"], "ndistinct" : 4}]" | I= nvalid "attributes" value. | | 22P02 + message | = detail | hint | sql_error_code=20 +-----------------------------------------------------------------------+--= ----------------------------------------+------+---------------- + malformed pg_ndistinct: "[{"attributes" : [2,"a"], "ndistinct" : 4}]" | K= ey "attributes" has an incorrect value. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [2,3], "ndistinct" : "= a"}]', 'pg_ndistinct'); - message | = detail | hint | sql_error_code=20 ------------------------------------------------------------------------+--= --------------------------+------+---------------- - malformed pg_ndistinct: "[{"attributes" : [2,3], "ndistinct" : "a"}]" | I= nvalid "ndistinct" value. | | 22P02 + message | = detail | hint | sql_error_code=20 +-----------------------------------------------------------------------+--= ---------------------------------------+------+---------------- + malformed pg_ndistinct: "[{"attributes" : [2,3], "ndistinct" : "a"}]" | K= ey "ndistinct" has an incorrect value. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [2,3], "ndistinct" : [= ]}]', 'pg_ndistinct'); - message | = detail | hint | sql_error_code=20 -----------------------------------------------------------------------+---= -------------------------------+------+---------------- - malformed pg_ndistinct: "[{"attributes" : [2,3], "ndistinct" : []}]" | Ar= ray found in unexpected place. | | 22P02 + message | = detail | hint | sql_error_code=20 +----------------------------------------------------------------------+---= ----------------------------------------------+------+---------------- + malformed pg_ndistinct: "[{"attributes" : [2,3], "ndistinct" : []}]" | Ar= ray has been found at an unexpected location. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [2,3], "ndistinct" : [= null]}]', 'pg_ndistinct'); - message = | detail | hint | sql_error_code=20 ---------------------------------------------------------------------------= +----------------------------------+------+---------------- - malformed pg_ndistinct: "[{"attributes" : [2,3], "ndistinct" : [null]}]" = | Array found in unexpected place. | | 22P02 + message = | detail | hint | sql_error_code= =20 +--------------------------------------------------------------------------= +-------------------------------------------------+------+---------------- + malformed pg_ndistinct: "[{"attributes" : [2,3], "ndistinct" : [null]}]" = | Array has been found at an unexpected location. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [2,3], "ndistinct" : [= 1,null]}]', 'pg_ndistinct'); - message = | detail | hint | sql_error_code=20 ---------------------------------------------------------------------------= --+----------------------------------+------+---------------- - malformed pg_ndistinct: "[{"attributes" : [2,3], "ndistinct" : [1,null]}]= " | Array found in unexpected place. | | 22P02 + message = | detail | hint | sql_error_code= =20 +--------------------------------------------------------------------------= --+-------------------------------------------------+------+---------------- + malformed pg_ndistinct: "[{"attributes" : [2,3], "ndistinct" : [1,null]}]= " | Array has been found at an unexpected location. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [2,3], "ndistinct" : {= "a": 1}}]', 'pg_ndistinct'); @@ -333,27 +333,27 @@ SELECT * FROM pg_input_error_info('[{"attributes" : [= 2,3], "ndistinct" : {"a": 1 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : 1, "ndistinct" : 4}]',= 'pg_ndistinct'); - message | d= etail | hint | sql_error_code=20 ------------------------------------------------------------------+--------= ------------+------+---------------- - malformed pg_ndistinct: "[{"attributes" : 1, "ndistinct" : 4}]" | Unexpec= ted scalar. | | 22P02 + message | = detail | hint | sql_error_code=20 +-----------------------------------------------------------------+--------= ---------------------------+------+---------------- + malformed pg_ndistinct: "[{"attributes" : 1, "ndistinct" : 4}]" | Unexpec= ted scalar has been found. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : [-7,-9], "ndistinct" := 1}]', 'pg_ndistinct'); - message | = detail | hint | sql_error_code=20 ------------------------------------------------------------------------+--= ---------------------------------+------+---------------- - malformed pg_ndistinct: "[{"attributes" : [-7,-9], "ndistinct" : 1}]" | I= nvalid "attributes" element: -9. | | 22P02 + message | = detail | hint | sql_error_code=20 +-----------------------------------------------------------------------+--= ------------------------------------------------+------+---------------- + malformed pg_ndistinct: "[{"attributes" : [-7,-9], "ndistinct" : 1}]" | I= nvalid "attributes" element has been found: -9. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : 1, "ndistinct" : 4}]',= 'pg_ndistinct'); - message | d= etail | hint | sql_error_code=20 ------------------------------------------------------------------+--------= ------------+------+---------------- - malformed pg_ndistinct: "[{"attributes" : 1, "ndistinct" : 4}]" | Unexpec= ted scalar. | | 22P02 + message | = detail | hint | sql_error_code=20 +-----------------------------------------------------------------+--------= ---------------------------+------+---------------- + malformed pg_ndistinct: "[{"attributes" : 1, "ndistinct" : 4}]" | Unexpec= ted scalar has been found. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : "a", "ndistinct" : 4}]= ', 'pg_ndistinct'); - message | = detail | hint | sql_error_code=20 --------------------------------------------------------------------+------= --------------+------+---------------- - malformed pg_ndistinct: "[{"attributes" : "a", "ndistinct" : 4}]" | Unexp= ected scalar. | | 22P02 + message | = detail | hint | sql_error_code=20 +-------------------------------------------------------------------+------= -----------------------------+------+---------------- + malformed pg_ndistinct: "[{"attributes" : "a", "ndistinct" : 4}]" | Unexp= ected scalar has been found. | | 22P02 (1 row) =20 SELECT * FROM pg_input_error_info('[{"attributes" : {"a": 1}, "ndistinct" = : 1}]', 'pg_ndistinct'); @@ -373,11 +373,11 @@ SELECT '[{"attributes" : [2,2], "ndistinct" : 4}]'::p= g_ndistinct; ERROR: malformed pg_ndistinct: "[{"attributes" : [2,2], "ndistinct" : 4}]" LINE 1: SELECT '[{"attributes" : [2,2], "ndistinct" : 4}]'::pg_ndist... ^ -DETAIL: Invalid "attributes" element: 2 cannot follow 2. +DETAIL: Invalid "attributes" element has been found: 2 cannot follow 2. SELECT * FROM pg_input_error_info('[{"attributes" : [2,2], "ndistinct" : 4= }]', 'pg_ndistinct'); - message | = detail | hint | sql_error_code=20 ----------------------------------------------------------------------+----= ----------------------------------------------+------+---------------- - malformed pg_ndistinct: "[{"attributes" : [2,2], "ndistinct" : 4}]" | Inv= alid "attributes" element: 2 cannot follow 2. | | 22P02 + message | = detail | hint | sql_e= rror_code=20 +---------------------------------------------------------------------+----= -------------------------------------------------------------+------+------= ---------- + malformed pg_ndistinct: "[{"attributes" : [2,2], "ndistinct" : 4}]" | Inv= alid "attributes" element has been found: 2 cannot follow 2. | | 22P02 (1 row) =20 -- Duplicated attribute lists. @@ -387,13 +387,13 @@ ERROR: malformed pg_ndistinct: "[{"attributes" : [2,= 3], "ndistinct" : 4}, {"attributes" : [2,3], "ndistinct" : 4}]" LINE 1: SELECT '[{"attributes" : [2,3], "ndistinct" : 4}, ^ -DETAIL: Duplicated "attributes" array found: [2, 3] +DETAIL: Duplicated "attributes" array has been found: [2, 3] SELECT * FROM pg_input_error_info('[{"attributes" : [2,3], "ndistinct" : 4= }, {"attributes" : [2,3], "ndistinct" : 4}]', 'pg_ndistinct'); - message | = detail | hint | sql_error_code=20 ---------------------------------------------------------------------+-----= ----------------------------------------+------+---------------- - malformed pg_ndistinct: "[{"attributes" : [2,3], "ndistinct" : 4},+| Dupl= icated "attributes" array found: [2, 3] | | 22P02 - {"attributes" : [2,3], "ndistinct" : 4}]" | = | |=20 + message | = detail | hint | sql_error_code=20 +--------------------------------------------------------------------+-----= -------------------------------------------------+------+---------------- + malformed pg_ndistinct: "[{"attributes" : [2,3], "ndistinct" : 4},+| Dupl= icated "attributes" array has been found: [2, 3] | | 22P02 + {"attributes" : [2,3], "ndistinct" : 4}]" | = | |=20 (1 row) =20 -- Partially-covered attribute lists. @@ -407,17 +407,17 @@ ERROR: malformed pg_ndistinct: "[{"attributes" : [2,= 3], "ndistinct" : 4}, {"attributes" : [1,3,-1,-2], "ndistinct" : 4}]" LINE 1: SELECT '[{"attributes" : [2,3], "ndistinct" : 4}, ^ -DETAIL: "attributes" array: [2, 3] must be a subset of array: [1, 3, -1, = -2] +DETAIL: "attributes" array [2, 3] must be a subset of array [1, 3, -1, -2= ]. SELECT * FROM pg_input_error_info('[{"attributes" : [2,3], "ndistinct" : 4= }, {"attributes" : [2,-1], "ndistinct" : 4}, {"attributes" : [2,3,-1], "ndistinct" : 4}, {"attributes" : [1,3,-1,-2], "ndistinct" : 4}]', 'pg_ndistinct'); - message | = detail | hint | s= ql_error_code=20 ---------------------------------------------------------------------+-----= -----------------------------------------------------------------+------+--= -------------- - malformed pg_ndistinct: "[{"attributes" : [2,3], "ndistinct" : 4},+| "att= ributes" array: [2, 3] must be a subset of array: [1, 3, -1, -2] | | 2= 2P02 - {"attributes" : [2,-1], "ndistinct" : 4}, +| = | |= =20 - {"attributes" : [2,3,-1], "ndistinct" : 4}, +| = | |= =20 - {"attributes" : [1,3,-1,-2], "ndistinct" : 4}]" | = | |= =20 + message | = detail | hint | sq= l_error_code=20 +--------------------------------------------------------------------+-----= ----------------------------------------------------------------+------+---= ------------- + malformed pg_ndistinct: "[{"attributes" : [2,3], "ndistinct" : 4},+| "att= ributes" array [2, 3] must be a subset of array [1, 3, -1, -2]. | | 22= P02 + {"attributes" : [2,-1], "ndistinct" : 4}, +| = | |=20 + {"attributes" : [2,3,-1], "ndistinct" : 4}, +| = | |=20 + {"attributes" : [1,3,-1,-2], "ndistinct" : 4}]" | = | |=20 (1 row) =20 -- Valid inputs --=20 2.51.0 --jbxw88jyHphMA3ez-- --oiY38TQJDPuYWisM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmkyMx8ACgkQnvQgOdby QH1bFQ/+LyvqyyhZvebiuYixRhY9Bu6WF9R+4iFwju0gGr/UYnk00341qdA+fEfo dg4iZ1OyauHpVfVOsiVFQGQW+N23ZACcNyLoIJAX7P31UWkJYDCIoor8KKCQhoXA ikIOum3Llq3/eFe7eeGEbiN1dO3mOx7p/PaLJraQqxv2ZKbS5GWCLXzh6XINTGeS XgwxzNtB6nhNVzULQzKXT1r7aReCFocJSKZnQ7QsmRJC7q7vFBT+z2rINW0yo/mm 3bP+Zxr1NM0fpj9I4+A1BUQeo0fzPkXmwNGNDjKFUNhHKCqX1vkqgNdwwY5aB0kZ LYax3EE/kp0qZmrSyUUXepn+5hPnZaCl063VQsfs+Y3o0jJmKnGMYa2XdaTa8x5X S6tZBrBrUqi3bWKMLuAIl3NtBMbnKTVOmxsJKyVOg4zFFvs2PZsZGikjDswwISNO aALHjUtuuJDEiLTu7xSzfGpBVqgnpU9atN3deUqrRhv3ESvsHu1T72L4gYAtp/xo XwtSbiFp3dxq3mHOFX6334J/qxRCcS7VQWcpyQQ0T+WymUOMN5mkRfe8iMzuVyMB r+PY3wIo2rDklYZyzNaertPK50Rw4r4mRWJK19XxdaB2KHHrloUboHnLg+VvrNvA x60wFv5ujKLo8IFs+Dh/ZVk9xpeozABoN7EaW1Mfp6kM5gwEOFo= =/IbC -----END PGP SIGNATURE----- --oiY38TQJDPuYWisM--