public inbox for [email protected]  
help / color / mirror / Atom feed
From: Corey Huinker <[email protected]>
To: Michael Paquier <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: jian he <[email protected]>
Cc: Tomas Vondra <[email protected]>
Cc: [email protected]
Subject: Re: Extended Statistics set/restore/clear functions.
Date: Fri, 5 Dec 2025 00:30:38 -0500
Message-ID: <CADkLM=fnhZQzrRRB4ig5FvDfZ0trrYugLk2_R6qyzDPG4ESLpg@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CADkLM=czQ0UUyBn3AiHZfJJWRwXH5e2xn056yG0mpuXpW09RSw@mail.gmail.com>
	<CACJufxHVKiVEvCsc11oxOM=0GgjqChFwi-ii4RJuw95ZFB_fHQ@mail.gmail.com>
	<CADkLM=eRop0t==hg0TU3KuDH6DgnUxQ6vZxV9th=6vW1JG36MQ@mail.gmail.com>
	<CACJufxGgEnOzFq0HjmkKBTnEUgToGFC0g0A4wPWoJMzOuoWUhw@mail.gmail.com>
	<CADkLM=crdyK3w7-EDEdDfXHGidxm2ms+bQYNFOZUD4eOLuLXEQ@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>

>
>
> Some of them are, yes.  However, they are also worded with the same
> format as some of the legit cases.  So they don't add any extra
> workload on the translation side as far as I recall, and I've been
> fond of the errdetail part to get a consistent style across the board.
> I'll double-check the whole a bit later, attached is the rest of them.
>
> Corey, any comments about these?
>

The wordings are fine, and I'm sorry I didn't word them as complete
sentences from the get-go.

Attached is a follow-on to Michael's most recent uncommitted patch,
changing the errors that I see as "impossible" to elogs. However, I agree
that they don't add significant workload to the translations, and most
input functions need to avoid any hard error returns lest they be called in
a soft-error context.


Attachments:

  [text/x-patch] v2-0002-Change-impossible-conditions-to-elogs.patch (2.3K, ../CADkLM=fnhZQzrRRB4ig5FvDfZ0trrYugLk2_R6qyzDPG4ESLpg@mail.gmail.com/3-v2-0002-Change-impossible-conditions-to-elogs.patch)
  download | inline diff:
From 9e7c703eb0ed04dde25a2a6e189f21e916e581bc Mon Sep 17 00:00:00 2001
From: Corey Huinker <[email protected]>
Date: Fri, 5 Dec 2025 00:24:02 -0500
Subject: [PATCH v1 2/2] Change impossible conditions to elogs.

---
 src/backend/utils/adt/pg_dependencies.c | 14 ++++++--------
 src/backend/utils/adt/pg_ndistinct.c    |  7 +++----
 2 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/src/backend/utils/adt/pg_dependencies.c b/src/backend/utils/adt/pg_dependencies.c
index 1552e03d1c1..7375e8498c5 100644
--- a/src/backend/utils/adt/pg_dependencies.c
+++ b/src/backend/utils/adt/pg_dependencies.c
@@ -326,10 +326,9 @@ dependencies_array_end(void *state)
 			 * This can only happen if a case was missed in
 			 * dependencies_array_start().
 			 */
-			errsave(parse->escontext,
-					errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
-					errmsg("malformed pg_dependencies: \"%s\"", parse->str),
-					errdetail("Array has been found at an unexpected location."));
+			elog(ERROR,
+				 "pg_dependencies array end encountered in unexpected parse state: %d.",
+				 (int) parse->state);
 			break;
 	}
 	return JSON_SEM_ACTION_FAILED;
@@ -443,10 +442,9 @@ dependencies_array_element_start(void *state, bool isnull)
 			break;
 
 		default:
-			errsave(parse->escontext,
-					errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
-					errmsg("malformed pg_dependencies: \"%s\"", parse->str),
-					errdetail("Unexpected array element has been found."));
+			elog(ERROR,
+				 "pg_dependencies array element encountered in unexpected parse state: %d.",
+				 (int) parse->state);
 			break;
 	}
 
diff --git a/src/backend/utils/adt/pg_ndistinct.c b/src/backend/utils/adt/pg_ndistinct.c
index 9bf1546c803..718d161ec41 100644
--- a/src/backend/utils/adt/pg_ndistinct.c
+++ b/src/backend/utils/adt/pg_ndistinct.c
@@ -286,10 +286,9 @@ ndistinct_array_end(void *state)
 			 * This can only happen if a case was missed in
 			 * ndistinct_array_start().
 			 */
-			errsave(parse->escontext,
-					errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
-					errmsg("malformed pg_ndistinct: \"%s\"", parse->str),
-					errdetail("Array has been found at an unexpected location."));
+			elog(ERROR,
+				 "pg_ndistinct array element encountered in unexpected parse state: %d.",
+				 (int) parse->state);
 			break;
 	}
 
-- 
2.52.0



view thread (91+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Extended Statistics set/restore/clear functions.
  In-Reply-To: <CADkLM=fnhZQzrRRB4ig5FvDfZ0trrYugLk2_R6qyzDPG4ESLpg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox