@@ -337,7 +337,7 @@ jsonb_path_match(PG_FUNCTION_ARGS)
337337
338338 if (!silent )
339339 ereport (ERROR ,
340- (errcode (ERRCODE_SINGLETON_JSON_ITEM_REQUIRED ),
340+ (errcode (ERRCODE_SINGLETON_SQL_JSON_ITEM_REQUIRED ),
341341 errmsg ("single boolean result is expected" )));
342342
343343 PG_RETURN_NULL ();
@@ -602,7 +602,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
602602 return jperError ;
603603
604604 ereport (ERROR ,
605- (errcode (ERRCODE_JSON_MEMBER_NOT_FOUND ), \
605+ (errcode (ERRCODE_SQL_JSON_MEMBER_NOT_FOUND ), \
606606 errmsg ("JSON object does not contain key \"%s\"" ,
607607 pnstrdup (key .val .string .val ,
608608 key .val .string .len ))));
@@ -614,7 +614,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
614614 {
615615 Assert (found );
616616 RETURN_ERROR (ereport (ERROR ,
617- (errcode (ERRCODE_JSON_MEMBER_NOT_FOUND ),
617+ (errcode (ERRCODE_SQL_JSON_MEMBER_NOT_FOUND ),
618618 errmsg ("jsonpath member accessor can only be applied to an object" ))));
619619 }
620620 break ;
@@ -643,7 +643,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
643643 res = executeNextItem (cxt , jsp , NULL , jb , found , true);
644644 else if (!jspIgnoreStructuralErrors (cxt ))
645645 RETURN_ERROR (ereport (ERROR ,
646- (errcode (ERRCODE_JSON_ARRAY_NOT_FOUND ),
646+ (errcode (ERRCODE_SQL_JSON_ARRAY_NOT_FOUND ),
647647 errmsg ("jsonpath wildcard array accessor can only be applied to an array" ))));
648648 break ;
649649
@@ -691,7 +691,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
691691 index_from > index_to ||
692692 index_to >= size ))
693693 RETURN_ERROR (ereport (ERROR ,
694- (errcode (ERRCODE_INVALID_JSON_SUBSCRIPT ),
694+ (errcode (ERRCODE_INVALID_SQL_JSON_SUBSCRIPT ),
695695 errmsg ("jsonpath array subscript is out of bounds" ))));
696696
697697 if (index_from < 0 )
@@ -748,7 +748,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
748748 else if (!jspIgnoreStructuralErrors (cxt ))
749749 {
750750 RETURN_ERROR (ereport (ERROR ,
751- (errcode (ERRCODE_JSON_ARRAY_NOT_FOUND ),
751+ (errcode (ERRCODE_SQL_JSON_ARRAY_NOT_FOUND ),
752752 errmsg ("jsonpath array accessor can only be applied to an array" ))));
753753 }
754754 break ;
@@ -802,7 +802,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
802802 {
803803 Assert (found );
804804 RETURN_ERROR (ereport (ERROR ,
805- (errcode (ERRCODE_JSON_OBJECT_NOT_FOUND ),
805+ (errcode (ERRCODE_SQL_JSON_OBJECT_NOT_FOUND ),
806806 errmsg ("jsonpath wildcard member accessor can only be applied to an object" ))));
807807 }
808808 break ;
@@ -932,7 +932,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
932932 {
933933 if (!jspIgnoreStructuralErrors (cxt ))
934934 RETURN_ERROR (ereport (ERROR ,
935- (errcode (ERRCODE_JSON_ARRAY_NOT_FOUND ),
935+ (errcode (ERRCODE_SQL_JSON_ARRAY_NOT_FOUND ),
936936 errmsg ("jsonpath item method .%s() can only be applied to an array" ,
937937 jspOperationName (jsp -> type )))));
938938 break ;
@@ -986,7 +986,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
986986
987987 if (have_error )
988988 RETURN_ERROR (ereport (ERROR ,
989- (errcode (ERRCODE_NON_NUMERIC_JSON_ITEM ),
989+ (errcode (ERRCODE_NON_NUMERIC_SQL_JSON_ITEM ),
990990 errmsg ("jsonpath item method .%s() can only be applied to a numeric value" ,
991991 jspOperationName (jsp -> type )))));
992992 res = jperOk ;
@@ -1007,7 +1007,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
10071007
10081008 if (have_error || isinf (val ))
10091009 RETURN_ERROR (ereport (ERROR ,
1010- (errcode (ERRCODE_NON_NUMERIC_JSON_ITEM ),
1010+ (errcode (ERRCODE_NON_NUMERIC_SQL_JSON_ITEM ),
10111011 errmsg ("jsonpath item method .%s() can only be applied to a numeric value" ,
10121012 jspOperationName (jsp -> type )))));
10131013
@@ -1020,7 +1020,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
10201020
10211021 if (res == jperNotFound )
10221022 RETURN_ERROR (ereport (ERROR ,
1023- (errcode (ERRCODE_NON_NUMERIC_JSON_ITEM ),
1023+ (errcode (ERRCODE_NON_NUMERIC_SQL_JSON_ITEM ),
10241024 errmsg ("jsonpath item method .%s() can only be applied to a string or numeric value" ,
10251025 jspOperationName (jsp -> type )))));
10261026
@@ -1504,14 +1504,14 @@ executeBinaryArithmExpr(JsonPathExecContext *cxt, JsonPathItem *jsp,
15041504 if (JsonValueListLength (& lseq ) != 1 ||
15051505 !(lval = getScalar (JsonValueListHead (& lseq ), jbvNumeric )))
15061506 RETURN_ERROR (ereport (ERROR ,
1507- (errcode (ERRCODE_SINGLETON_JSON_ITEM_REQUIRED ),
1507+ (errcode (ERRCODE_SINGLETON_SQL_JSON_ITEM_REQUIRED ),
15081508 errmsg ("left operand of jsonpath operator %s is not a single numeric value" ,
15091509 jspOperationName (jsp -> type )))));
15101510
15111511 if (JsonValueListLength (& rseq ) != 1 ||
15121512 !(rval = getScalar (JsonValueListHead (& rseq ), jbvNumeric )))
15131513 RETURN_ERROR (ereport (ERROR ,
1514- (errcode (ERRCODE_SINGLETON_JSON_ITEM_REQUIRED ),
1514+ (errcode (ERRCODE_SINGLETON_SQL_JSON_ITEM_REQUIRED ),
15151515 errmsg ("right operand of jsonpath operator %s is not a single numeric value" ,
15161516 jspOperationName (jsp -> type )))));
15171517
@@ -1579,7 +1579,7 @@ executeUnaryArithmExpr(JsonPathExecContext *cxt, JsonPathItem *jsp,
15791579 continue ; /* skip non-numerics processing */
15801580
15811581 RETURN_ERROR (ereport (ERROR ,
1582- (errcode (ERRCODE_JSON_NUMBER_NOT_FOUND ),
1582+ (errcode (ERRCODE_SQL_JSON_NUMBER_NOT_FOUND ),
15831583 errmsg ("operand of unary jsonpath operator %s is not a numeric value" ,
15841584 jspOperationName (jsp -> type )))));
15851585 }
@@ -1701,7 +1701,7 @@ executeNumericItemMethod(JsonPathExecContext *cxt, JsonPathItem *jsp,
17011701
17021702 if (!(jb = getScalar (jb , jbvNumeric )))
17031703 RETURN_ERROR (ereport (ERROR ,
1704- (errcode (ERRCODE_NON_NUMERIC_JSON_ITEM ),
1704+ (errcode (ERRCODE_NON_NUMERIC_SQL_JSON_ITEM ),
17051705 errmsg ("jsonpath item method .%s() can only be applied to a numeric value" ,
17061706 jspOperationName (jsp -> type )))));
17071707
@@ -1760,7 +1760,7 @@ executeKeyValueMethod(JsonPathExecContext *cxt, JsonPathItem *jsp,
17601760
17611761 if (JsonbType (jb ) != jbvObject || jb -> type != jbvBinary )
17621762 RETURN_ERROR (ereport (ERROR ,
1763- (errcode (ERRCODE_JSON_OBJECT_NOT_FOUND ),
1763+ (errcode (ERRCODE_SQL_JSON_OBJECT_NOT_FOUND ),
17641764 errmsg ("jsonpath item method .%s() can only be applied to an object" ,
17651765 jspOperationName (jsp -> type )))));
17661766
@@ -2190,7 +2190,7 @@ getArrayIndex(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonbValue *jb,
21902190 if (JsonValueListLength (& found ) != 1 ||
21912191 !(jbv = getScalar (JsonValueListHead (& found ), jbvNumeric )))
21922192 RETURN_ERROR (ereport (ERROR ,
2193- (errcode (ERRCODE_INVALID_JSON_SUBSCRIPT ),
2193+ (errcode (ERRCODE_INVALID_SQL_JSON_SUBSCRIPT ),
21942194 errmsg ("jsonpath array subscript is not a single numeric value" ))));
21952195
21962196 numeric_index = DirectFunctionCall2 (numeric_trunc ,
@@ -2202,7 +2202,7 @@ getArrayIndex(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonbValue *jb,
22022202
22032203 if (have_error )
22042204 RETURN_ERROR (ereport (ERROR ,
2205- (errcode (ERRCODE_INVALID_JSON_SUBSCRIPT ),
2205+ (errcode (ERRCODE_INVALID_SQL_JSON_SUBSCRIPT ),
22062206 errmsg ("jsonpath array subscript is out of integer range" ))));
22072207
22082208 return jperOk ;
0 commit comments