Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb681ca7

Browse files
committed
Add another SQL/JSON error code
A code comment said that the standard does not define a number forERRCODE_SQL_JSON_ITEM_CANNOT_BE_CAST_TO_TARGET_TYPE, but this wasfixed in a later draft version of the standard, so use that numbernow.
1 parent96dbbf8 commitb681ca7

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

‎src/backend/executor/execExprInterp.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4980,13 +4980,7 @@ ExecEvalJsonExpr(ExprEvalStep *op, ExprContext *econtext,
49804980
* type simply does not exist.
49814981
*/
49824982
ereport(ERROR,
4983-
4984-
/*
4985-
* XXX Standard says about a separate error code
4986-
* ERRCODE_SQL_JSON_ITEM_CANNOT_BE_CAST_TO_TARGET_TYPE but
4987-
* does not define its number.
4988-
*/
4989-
(errcode(ERRCODE_SQL_JSON_SCALAR_REQUIRED),
4983+
(errcode(ERRCODE_SQL_JSON_ITEM_CANNOT_BE_CAST_TO_TARGET_TYPE),
49904984
errmsg("SQL/JSON item cannot be cast to target type")));
49914985
}
49924986
elseif (!jcstate->estate)

‎src/backend/utils/errcodes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ Section: Class 22 - Data Exception
222222
2203D E ERRCODE_TOO_MANY_JSON_ARRAY_ELEMENTS too_many_json_array_elements
223223
2203E E ERRCODE_TOO_MANY_JSON_OBJECT_MEMBERS too_many_json_object_members
224224
2203F E ERRCODE_SQL_JSON_SCALAR_REQUIRED sql_json_scalar_required
225+
2203G E ERRCODE_SQL_JSON_ITEM_CANNOT_BE_CAST_TO_TARGET_TYPE sql_json_item_cannot_be_cast_to_target_type
225226

226227
Section: Class 23 - Integrity Constraint Violation
227228

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp