@@ -337,7 +337,7 @@ jsonb_path_match(PG_FUNCTION_ARGS)
337
337
338
338
if (!silent )
339
339
ereport (ERROR ,
340
- (errcode (ERRCODE_SINGLETON_JSON_ITEM_REQUIRED ),
340
+ (errcode (ERRCODE_SINGLETON_SQL_JSON_ITEM_REQUIRED ),
341
341
errmsg ("single boolean result is expected" )));
342
342
343
343
PG_RETURN_NULL ();
@@ -602,7 +602,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
602
602
return jperError ;
603
603
604
604
ereport (ERROR ,
605
- (errcode (ERRCODE_JSON_MEMBER_NOT_FOUND ), \
605
+ (errcode (ERRCODE_SQL_JSON_MEMBER_NOT_FOUND ), \
606
606
errmsg ("JSON object does not contain key \"%s\"" ,
607
607
pnstrdup (key .val .string .val ,
608
608
key .val .string .len ))));
@@ -614,7 +614,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
614
614
{
615
615
Assert (found );
616
616
RETURN_ERROR (ereport (ERROR ,
617
- (errcode (ERRCODE_JSON_MEMBER_NOT_FOUND ),
617
+ (errcode (ERRCODE_SQL_JSON_MEMBER_NOT_FOUND ),
618
618
errmsg ("jsonpath member accessor can only be applied to an object" ))));
619
619
}
620
620
break ;
@@ -643,7 +643,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
643
643
res = executeNextItem (cxt , jsp , NULL , jb , found , true);
644
644
else if (!jspIgnoreStructuralErrors (cxt ))
645
645
RETURN_ERROR (ereport (ERROR ,
646
- (errcode (ERRCODE_JSON_ARRAY_NOT_FOUND ),
646
+ (errcode (ERRCODE_SQL_JSON_ARRAY_NOT_FOUND ),
647
647
errmsg ("jsonpath wildcard array accessor can only be applied to an array" ))));
648
648
break ;
649
649
@@ -691,7 +691,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
691
691
index_from > index_to ||
692
692
index_to >= size ))
693
693
RETURN_ERROR (ereport (ERROR ,
694
- (errcode (ERRCODE_INVALID_JSON_SUBSCRIPT ),
694
+ (errcode (ERRCODE_INVALID_SQL_JSON_SUBSCRIPT ),
695
695
errmsg ("jsonpath array subscript is out of bounds" ))));
696
696
697
697
if (index_from < 0 )
@@ -748,7 +748,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
748
748
else if (!jspIgnoreStructuralErrors (cxt ))
749
749
{
750
750
RETURN_ERROR (ereport (ERROR ,
751
- (errcode (ERRCODE_JSON_ARRAY_NOT_FOUND ),
751
+ (errcode (ERRCODE_SQL_JSON_ARRAY_NOT_FOUND ),
752
752
errmsg ("jsonpath array accessor can only be applied to an array" ))));
753
753
}
754
754
break ;
@@ -802,7 +802,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
802
802
{
803
803
Assert (found );
804
804
RETURN_ERROR (ereport (ERROR ,
805
- (errcode (ERRCODE_JSON_OBJECT_NOT_FOUND ),
805
+ (errcode (ERRCODE_SQL_JSON_OBJECT_NOT_FOUND ),
806
806
errmsg ("jsonpath wildcard member accessor can only be applied to an object" ))));
807
807
}
808
808
break ;
@@ -932,7 +932,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
932
932
{
933
933
if (!jspIgnoreStructuralErrors (cxt ))
934
934
RETURN_ERROR (ereport (ERROR ,
935
- (errcode (ERRCODE_JSON_ARRAY_NOT_FOUND ),
935
+ (errcode (ERRCODE_SQL_JSON_ARRAY_NOT_FOUND ),
936
936
errmsg ("jsonpath item method .%s() can only be applied to an array" ,
937
937
jspOperationName (jsp -> type )))));
938
938
break ;
@@ -986,7 +986,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
986
986
987
987
if (have_error )
988
988
RETURN_ERROR (ereport (ERROR ,
989
- (errcode (ERRCODE_NON_NUMERIC_JSON_ITEM ),
989
+ (errcode (ERRCODE_NON_NUMERIC_SQL_JSON_ITEM ),
990
990
errmsg ("jsonpath item method .%s() can only be applied to a numeric value" ,
991
991
jspOperationName (jsp -> type )))));
992
992
res = jperOk ;
@@ -1007,7 +1007,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
1007
1007
1008
1008
if (have_error || isinf (val ))
1009
1009
RETURN_ERROR (ereport (ERROR ,
1010
- (errcode (ERRCODE_NON_NUMERIC_JSON_ITEM ),
1010
+ (errcode (ERRCODE_NON_NUMERIC_SQL_JSON_ITEM ),
1011
1011
errmsg ("jsonpath item method .%s() can only be applied to a numeric value" ,
1012
1012
jspOperationName (jsp -> type )))));
1013
1013
@@ -1020,7 +1020,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
1020
1020
1021
1021
if (res == jperNotFound )
1022
1022
RETURN_ERROR (ereport (ERROR ,
1023
- (errcode (ERRCODE_NON_NUMERIC_JSON_ITEM ),
1023
+ (errcode (ERRCODE_NON_NUMERIC_SQL_JSON_ITEM ),
1024
1024
errmsg ("jsonpath item method .%s() can only be applied to a string or numeric value" ,
1025
1025
jspOperationName (jsp -> type )))));
1026
1026
@@ -1504,14 +1504,14 @@ executeBinaryArithmExpr(JsonPathExecContext *cxt, JsonPathItem *jsp,
1504
1504
if (JsonValueListLength (& lseq ) != 1 ||
1505
1505
!(lval = getScalar (JsonValueListHead (& lseq ), jbvNumeric )))
1506
1506
RETURN_ERROR (ereport (ERROR ,
1507
- (errcode (ERRCODE_SINGLETON_JSON_ITEM_REQUIRED ),
1507
+ (errcode (ERRCODE_SINGLETON_SQL_JSON_ITEM_REQUIRED ),
1508
1508
errmsg ("left operand of jsonpath operator %s is not a single numeric value" ,
1509
1509
jspOperationName (jsp -> type )))));
1510
1510
1511
1511
if (JsonValueListLength (& rseq ) != 1 ||
1512
1512
!(rval = getScalar (JsonValueListHead (& rseq ), jbvNumeric )))
1513
1513
RETURN_ERROR (ereport (ERROR ,
1514
- (errcode (ERRCODE_SINGLETON_JSON_ITEM_REQUIRED ),
1514
+ (errcode (ERRCODE_SINGLETON_SQL_JSON_ITEM_REQUIRED ),
1515
1515
errmsg ("right operand of jsonpath operator %s is not a single numeric value" ,
1516
1516
jspOperationName (jsp -> type )))));
1517
1517
@@ -1579,7 +1579,7 @@ executeUnaryArithmExpr(JsonPathExecContext *cxt, JsonPathItem *jsp,
1579
1579
continue ; /* skip non-numerics processing */
1580
1580
1581
1581
RETURN_ERROR (ereport (ERROR ,
1582
- (errcode (ERRCODE_JSON_NUMBER_NOT_FOUND ),
1582
+ (errcode (ERRCODE_SQL_JSON_NUMBER_NOT_FOUND ),
1583
1583
errmsg ("operand of unary jsonpath operator %s is not a numeric value" ,
1584
1584
jspOperationName (jsp -> type )))));
1585
1585
}
@@ -1701,7 +1701,7 @@ executeNumericItemMethod(JsonPathExecContext *cxt, JsonPathItem *jsp,
1701
1701
1702
1702
if (!(jb = getScalar (jb , jbvNumeric )))
1703
1703
RETURN_ERROR (ereport (ERROR ,
1704
- (errcode (ERRCODE_NON_NUMERIC_JSON_ITEM ),
1704
+ (errcode (ERRCODE_NON_NUMERIC_SQL_JSON_ITEM ),
1705
1705
errmsg ("jsonpath item method .%s() can only be applied to a numeric value" ,
1706
1706
jspOperationName (jsp -> type )))));
1707
1707
@@ -1760,7 +1760,7 @@ executeKeyValueMethod(JsonPathExecContext *cxt, JsonPathItem *jsp,
1760
1760
1761
1761
if (JsonbType (jb ) != jbvObject || jb -> type != jbvBinary )
1762
1762
RETURN_ERROR (ereport (ERROR ,
1763
- (errcode (ERRCODE_JSON_OBJECT_NOT_FOUND ),
1763
+ (errcode (ERRCODE_SQL_JSON_OBJECT_NOT_FOUND ),
1764
1764
errmsg ("jsonpath item method .%s() can only be applied to an object" ,
1765
1765
jspOperationName (jsp -> type )))));
1766
1766
@@ -2190,7 +2190,7 @@ getArrayIndex(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonbValue *jb,
2190
2190
if (JsonValueListLength (& found ) != 1 ||
2191
2191
!(jbv = getScalar (JsonValueListHead (& found ), jbvNumeric )))
2192
2192
RETURN_ERROR (ereport (ERROR ,
2193
- (errcode (ERRCODE_INVALID_JSON_SUBSCRIPT ),
2193
+ (errcode (ERRCODE_INVALID_SQL_JSON_SUBSCRIPT ),
2194
2194
errmsg ("jsonpath array subscript is not a single numeric value" ))));
2195
2195
2196
2196
numeric_index = DirectFunctionCall2 (numeric_trunc ,
@@ -2202,7 +2202,7 @@ getArrayIndex(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonbValue *jb,
2202
2202
2203
2203
if (have_error )
2204
2204
RETURN_ERROR (ereport (ERROR ,
2205
- (errcode (ERRCODE_INVALID_JSON_SUBSCRIPT ),
2205
+ (errcode (ERRCODE_INVALID_SQL_JSON_SUBSCRIPT ),
2206
2206
errmsg ("jsonpath array subscript is out of integer range" ))));
2207
2207
2208
2208
return jperOk ;
0 commit comments