diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2024-08-07 11:30:36 -0400 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2024-08-07 11:30:36 -0400 |
commit | 899f39ea25f2ee63a0c557f3908e15b280a4367a (patch) | |
tree | 0fc7fa2c1b1b7c91ee89dedee100db5c58654d3c /src/backend/executor/execExprInterp.c | |
parent | ffac8ac48e409bbc7c2d9a4b37a1c39908ca24eb (diff) | |
download | postgresql-899f39ea25f2ee63a0c557f3908e15b280a4367a.tar.gz postgresql-899f39ea25f2ee63a0c557f3908e15b280a4367a.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/execExprInterp.c')
-rw-r--r-- | src/backend/executor/execExprInterp.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/executor/execExprInterp.c b/src/backend/executor/execExprInterp.c index 1633ea83731..c32ac7c5098 100644 --- a/src/backend/executor/execExprInterp.c +++ b/src/backend/executor/execExprInterp.c @@ -4634,13 +4634,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))); |