1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-27 23:21:58 +03:00

Fix error message wording

The originals are ambiguous and a bit out of style.

Reviewed-by: Amit Langote <amitlangote09@gmail.com>
Discussion: https://postgr.es/m/202412141243.efesjyyvzxsz@alvherre.pgsql
This commit is contained in:
Álvaro Herrera
2025-01-07 20:07:32 +01:00
parent c4782c4410
commit 0e5b14410e
3 changed files with 7 additions and 6 deletions

View File

@ -4113,8 +4113,9 @@ transformJsonReturning(ParseState *pstate, JsonOutput *output, const char *fname
if (returning->typid != JSONOID && returning->typid != JSONBOID)
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
errmsg("cannot use RETURNING type %s in %s",
errmsg("cannot use type %s in RETURNING clause of %s",
format_type_be(returning->typid), fname),
errhint("Try returning json or jsonb."),
parser_errposition(pstate, output->typeName->location)));
}
else
@ -4233,7 +4234,7 @@ transformJsonSerializeExpr(ParseState *pstate, JsonSerializeExpr *expr)
if (typcategory != TYPCATEGORY_STRING)
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
errmsg("cannot use RETURNING type %s in %s",
errmsg("cannot use type %s in RETURNING clause of %s",
format_type_be(returning->typid),
"JSON_SERIALIZE()"),
errhint("Try returning a string type or bytea.")));