@@ -61,6 +61,7 @@ typedef struct
6161#define JsonbNestedContainsStrategyNumber 13
6262#define JsQueryMatchStrategyNumber 14
6363#define JsonpathExistsStrategyNumber 15
64+ #define JsonpathMatchStrategyNumber 16
6465
6566typedef struct
6667{
@@ -587,7 +588,8 @@ gin_compare_partial_jsonb_value_path(PG_FUNCTION_ARGS)
587588 int32 result ;
588589
589590 if (strategy == JsQueryMatchStrategyNumber ||
590- strategy == JsonpathExistsStrategyNumber )
591+ strategy == JsonpathExistsStrategyNumber ||
592+ strategy == JsonpathMatchStrategyNumber )
591593 {
592594 KeyExtra * extra = (KeyExtra * )PG_GETARG_POINTER (3 );
593595 ExtractedNode * node = extra -> node ;
@@ -809,8 +811,10 @@ gin_extract_jsonb_query_value_path(PG_FUNCTION_ARGS)
809811 case JsQueryMatchStrategyNumber :
810812#ifndef NO_JSONPATH
811813 case JsonpathExistsStrategyNumber :
812- if (strategy == JsonpathExistsStrategyNumber )
814+ case JsonpathMatchStrategyNumber :
815+ if (strategy != JsQueryMatchStrategyNumber )
813816 root = extractJsonPath (PG_GETARG_JSONPATH_P (0 ),
817+ strategy == JsonpathExistsStrategyNumber ,
814818 make_value_path_entry_handler ,
815819 check_value_path_entry_handler ,
816820 (Pointer )& e );
@@ -878,6 +882,7 @@ gin_consistent_jsonb_value_path(PG_FUNCTION_ARGS)
878882
879883 case JsQueryMatchStrategyNumber :
880884 case JsonpathExistsStrategyNumber :
885+ case JsonpathMatchStrategyNumber :
881886 if (nkeys == 0 )
882887 res = true;
883888 else
@@ -940,6 +945,7 @@ gin_triconsistent_jsonb_value_path(PG_FUNCTION_ARGS)
940945
941946 case JsQueryMatchStrategyNumber :
942947 case JsonpathExistsStrategyNumber :
948+ case JsonpathMatchStrategyNumber :
943949 if (nkeys == 0 )
944950 res = GIN_MAYBE ;
945951 else
@@ -1063,7 +1069,8 @@ gin_compare_partial_jsonb_path_value(PG_FUNCTION_ARGS)
10631069 result = (key -> hash > partial_key -> hash ) ? 1 : -1 ;
10641070 }
10651071 else if (strategy == JsQueryMatchStrategyNumber ||
1066- strategy == JsonpathExistsStrategyNumber )
1072+ strategy == JsonpathExistsStrategyNumber ||
1073+ strategy == JsonpathMatchStrategyNumber )
10671074 {
10681075 KeyExtra * extra = (KeyExtra * )PG_GETARG_POINTER (3 );
10691076 ExtractedNode * node = extra -> node ;
@@ -1276,8 +1283,10 @@ gin_extract_jsonb_query_path_value_internal(FunctionCallInfo fcinfo, bool lax)
12761283 case JsQueryMatchStrategyNumber :
12771284#ifndef NO_JSONPATH
12781285 case JsonpathExistsStrategyNumber :
1279- if (strategy == JsonpathExistsStrategyNumber )
1286+ case JsonpathMatchStrategyNumber :
1287+ if (strategy != JsQueryMatchStrategyNumber )
12801288 root = extractJsonPath (PG_GETARG_JSONPATH_P (0 ),
1289+ strategy == JsonpathExistsStrategyNumber ,
12811290 make_path_value_entry_handler ,
12821291 check_path_value_entry_handler ,
12831292 (Pointer ) & extra );
@@ -1356,6 +1365,7 @@ gin_consistent_jsonb_path_value(PG_FUNCTION_ARGS)
13561365
13571366 case JsQueryMatchStrategyNumber :
13581367 case JsonpathExistsStrategyNumber :
1368+ case JsonpathMatchStrategyNumber :
13591369 if (nkeys == 0 )
13601370 res = true;
13611371 else
@@ -1418,6 +1428,7 @@ gin_triconsistent_jsonb_path_value(PG_FUNCTION_ARGS)
14181428
14191429 case JsQueryMatchStrategyNumber :
14201430 case JsonpathExistsStrategyNumber :
1431+ case JsonpathMatchStrategyNumber :
14211432 if (nkeys == 0 )
14221433 res = GIN_MAYBE ;
14231434 else
0 commit comments