aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorÁlvaro Herrera <alvherre@alvh.no-ip.org>2025-01-07 20:07:32 +0100
committerÁlvaro Herrera <alvherre@alvh.no-ip.org>2025-01-07 20:07:32 +0100
commitd7905aa1da00115d56ca199b848bcc93fbedf2c8 (patch)
tree9d301c08e12b50930d0a8541b356f3fe18d7576a /src/backend
parente998901b8873d2cc06fb1a8df8d862fda9630775 (diff)
downloadpostgresql-d7905aa1da00115d56ca199b848bcc93fbedf2c8.tar.gz
postgresql-d7905aa1da00115d56ca199b848bcc93fbedf2c8.zip
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
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/parser/parse_expr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c
index ef0b560f5e3..3905dd36340 100644
--- a/src/backend/parser/parse_expr.c
+++ b/src/backend/parser/parse_expr.c
@@ -4115,8 +4115,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
@@ -4235,7 +4236,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.")));