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