strangely worded message
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Amit Langote <amitlangote09@gmail.com>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-12-14T12:43:46Z
Lists: pgsql-hackers
Hello
The following message introduced by commit 03734a7fed7d appears in two
places:
if (returning->typid != JSONOID && returning->typid != JSONBOID)
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
errmsg("cannot use RETURNING type %s in %s",
format_type_be(returning->typid), fname),
parser_errposition(pstate, output->typeName->location)));
where fname is either JSON(), JSON_SCALAR(), JSON_SERIALIZE(). The
wording seems a bit off to me. What about the following?
ERROR: cannot use type %s in RETURNING clause of %s
DETAIL: Only types json and jsonb are allowed in the RETURNING clause.
Other ideas I considered:
ERROR: cannot use RETURNING %s in %s
ERROR: cannot use "RETURNING %s" in %s
DETAIL: The type can be json or jsonb in RETURNING.
DETAIL: The RETURNING clause allows types json or jsonb.
DETAIL: Types json and jsonb are allowed in RETURNING.
Thanks
--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
Commits
-
Fix error message wording
- d7905aa1da00 17.3 landed
- 0e5b14410e2b 18.0 landed
-
Add more SQL/JSON constructor functions
- 03734a7fed7d 17.0 cited