mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Add another SQL/JSON error code
A code comment said that the standard does not define a number for ERRCODE_SQL_JSON_ITEM_CANNOT_BE_CAST_TO_TARGET_TYPE, but this was fixed in a later draft version of the standard, so use that number now.
This commit is contained in:
@ -4980,13 +4980,7 @@ ExecEvalJsonExpr(ExprEvalStep *op, ExprContext *econtext,
|
||||
* type simply does not exist.
|
||||
*/
|
||||
ereport(ERROR,
|
||||
|
||||
/*
|
||||
* XXX Standard says about a separate error code
|
||||
* ERRCODE_SQL_JSON_ITEM_CANNOT_BE_CAST_TO_TARGET_TYPE but
|
||||
* does not define its number.
|
||||
*/
|
||||
(errcode(ERRCODE_SQL_JSON_SCALAR_REQUIRED),
|
||||
(errcode(ERRCODE_SQL_JSON_ITEM_CANNOT_BE_CAST_TO_TARGET_TYPE),
|
||||
errmsg("SQL/JSON item cannot be cast to target type")));
|
||||
}
|
||||
else if (!jcstate->estate)
|
||||
|
Reference in New Issue
Block a user