aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2024-08-07 11:30:36 -0400
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2024-08-07 11:30:36 -0400
commit2bb969f3998489e5dc4fe9f2a61185b43581975d (patch)
treeef08aa9d05f0e8c029fff450da5887ed3831ce96 /src/backend/executor
parent22b4a1b561f830f2af80c21450a4c05f6efbb698 (diff)
downloadpostgresql-2bb969f3998489e5dc4fe9f2a61185b43581975d.tar.gz
postgresql-2bb969f3998489e5dc4fe9f2a61185b43581975d.zip
Refactor/reword some error messages to avoid duplicates
Also, remove brackets around "EMPTY [ ARRAY ]". An error message is not the place to state that a keyword is optional. Backpatch to 17.
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/execExprInterp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/executor/execExprInterp.c b/src/backend/executor/execExprInterp.c
index 1535fd6b984..ea47c4d6f9c 100644
--- a/src/backend/executor/execExprInterp.c
+++ b/src/backend/executor/execExprInterp.c
@@ -4660,13 +4660,17 @@ ExecEvalJsonCoercionFinish(ExprState *state, ExprEvalStep *op)
if (DatumGetBool(jsestate->error.value))
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
- errmsg("could not coerce ON ERROR expression (%s) to the RETURNING type",
+ /*- translator: first %s is a SQL/JSON clause (e.g. ON ERROR) */
+ errmsg("could not coerce %s expression (%s) to the RETURNING type",
+ "ON ERROR",
GetJsonBehaviorValueString(jsestate->jsexpr->on_error)),
errdetail("%s", jsestate->escontext.error_data->message)));
else if (DatumGetBool(jsestate->empty.value))
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
- errmsg("could not coerce ON EMPTY expression (%s) to the RETURNING type",
+ /*- translator: first %s is a SQL/JSON clause (e.g. ON ERROR) */
+ errmsg("could not coerce %s expression (%s) to the RETURNING type",
+ "ON EMPTY",
GetJsonBehaviorValueString(jsestate->jsexpr->on_empty)),
errdetail("%s", jsestate->escontext.error_data->message)));