@@ -61,6 +61,7 @@ typedef struct
61
61
#define JsonbNestedContainsStrategyNumber 13
62
62
#define JsQueryMatchStrategyNumber 14
63
63
#define JsonpathExistsStrategyNumber 15
64
+ #define JsonpathMatchStrategyNumber 16
64
65
65
66
typedef struct
66
67
{
@@ -587,7 +588,8 @@ gin_compare_partial_jsonb_value_path(PG_FUNCTION_ARGS)
587
588
int32 result ;
588
589
589
590
if (strategy == JsQueryMatchStrategyNumber ||
590
- strategy == JsonpathExistsStrategyNumber )
591
+ strategy == JsonpathExistsStrategyNumber ||
592
+ strategy == JsonpathMatchStrategyNumber )
591
593
{
592
594
KeyExtra * extra = (KeyExtra * )PG_GETARG_POINTER (3 );
593
595
ExtractedNode * node = extra -> node ;
@@ -809,8 +811,10 @@ gin_extract_jsonb_query_value_path(PG_FUNCTION_ARGS)
809
811
case JsQueryMatchStrategyNumber :
810
812
#ifndef NO_JSONPATH
811
813
case JsonpathExistsStrategyNumber :
812
- if (strategy == JsonpathExistsStrategyNumber )
814
+ case JsonpathMatchStrategyNumber :
815
+ if (strategy != JsQueryMatchStrategyNumber )
813
816
root = extractJsonPath (PG_GETARG_JSONPATH_P (0 ),
817
+ strategy == JsonpathExistsStrategyNumber ,
814
818
make_value_path_entry_handler ,
815
819
check_value_path_entry_handler ,
816
820
(Pointer )& e );
@@ -878,6 +882,7 @@ gin_consistent_jsonb_value_path(PG_FUNCTION_ARGS)
878
882
879
883
case JsQueryMatchStrategyNumber :
880
884
case JsonpathExistsStrategyNumber :
885
+ case JsonpathMatchStrategyNumber :
881
886
if (nkeys == 0 )
882
887
res = true;
883
888
else
@@ -940,6 +945,7 @@ gin_triconsistent_jsonb_value_path(PG_FUNCTION_ARGS)
940
945
941
946
case JsQueryMatchStrategyNumber :
942
947
case JsonpathExistsStrategyNumber :
948
+ case JsonpathMatchStrategyNumber :
943
949
if (nkeys == 0 )
944
950
res = GIN_MAYBE ;
945
951
else
@@ -1063,7 +1069,8 @@ gin_compare_partial_jsonb_path_value(PG_FUNCTION_ARGS)
1063
1069
result = (key -> hash > partial_key -> hash ) ? 1 : -1 ;
1064
1070
}
1065
1071
else if (strategy == JsQueryMatchStrategyNumber ||
1066
- strategy == JsonpathExistsStrategyNumber )
1072
+ strategy == JsonpathExistsStrategyNumber ||
1073
+ strategy == JsonpathMatchStrategyNumber )
1067
1074
{
1068
1075
KeyExtra * extra = (KeyExtra * )PG_GETARG_POINTER (3 );
1069
1076
ExtractedNode * node = extra -> node ;
@@ -1276,8 +1283,10 @@ gin_extract_jsonb_query_path_value_internal(FunctionCallInfo fcinfo, bool lax)
1276
1283
case JsQueryMatchStrategyNumber :
1277
1284
#ifndef NO_JSONPATH
1278
1285
case JsonpathExistsStrategyNumber :
1279
- if (strategy == JsonpathExistsStrategyNumber )
1286
+ case JsonpathMatchStrategyNumber :
1287
+ if (strategy != JsQueryMatchStrategyNumber )
1280
1288
root = extractJsonPath (PG_GETARG_JSONPATH_P (0 ),
1289
+ strategy == JsonpathExistsStrategyNumber ,
1281
1290
make_path_value_entry_handler ,
1282
1291
check_path_value_entry_handler ,
1283
1292
(Pointer ) & extra );
@@ -1356,6 +1365,7 @@ gin_consistent_jsonb_path_value(PG_FUNCTION_ARGS)
1356
1365
1357
1366
case JsQueryMatchStrategyNumber :
1358
1367
case JsonpathExistsStrategyNumber :
1368
+ case JsonpathMatchStrategyNumber :
1359
1369
if (nkeys == 0 )
1360
1370
res = true;
1361
1371
else
@@ -1418,6 +1428,7 @@ gin_triconsistent_jsonb_path_value(PG_FUNCTION_ARGS)
1418
1428
1419
1429
case JsQueryMatchStrategyNumber :
1420
1430
case JsonpathExistsStrategyNumber :
1431
+ case JsonpathMatchStrategyNumber :
1421
1432
if (nkeys == 0 )
1422
1433
res = GIN_MAYBE ;
1423
1434
else
0 commit comments