@@ -315,9 +315,9 @@ gin_triconsistent_jsonb(PG_FUNCTION_ARGS)
315
315
316
316
/*
317
317
*
318
- *jsonb_hash_ops GIN opclass support functions
318
+ *jsonb_path_ops GIN opclass support functions
319
319
*
320
- * In ajsonb_hash_ops index, the GIN keys are uint32 hashes, one per JSON
320
+ * In ajsonb_path_ops index, the GIN keys are uint32 hashes, one per JSON
321
321
* value; but the JSON key(s) leading to each value are also included in its
322
322
* hash computation. This means we can only support containment queries,
323
323
* but the index can distinguish, for example, {"foo": 42} from {"bar": 42}
@@ -326,7 +326,7 @@ gin_triconsistent_jsonb(PG_FUNCTION_ARGS)
326
326
*/
327
327
328
328
Datum
329
- gin_extract_jsonb_hash (PG_FUNCTION_ARGS )
329
+ gin_extract_jsonb_path (PG_FUNCTION_ARGS )
330
330
{
331
331
Jsonb * jb = PG_GETARG_JSONB (0 );
332
332
int32 * nentries = (int32 * )PG_GETARG_POINTER (1 );
@@ -349,7 +349,7 @@ gin_extract_jsonb_hash(PG_FUNCTION_ARGS)
349
349
/* Otherwise, use 2 * root count as initial estimate of result size */
350
350
entries = (Datum * )palloc (sizeof (Datum )* total );
351
351
352
- /* We keep a stack of hashes corresponding to parent key levels */
352
+ /* We keep a stack ofpartial hashes corresponding to parent key levels */
353
353
tail .parent = NULL ;
354
354
tail .hash = 0 ;
355
355
stack = & tail ;
@@ -439,7 +439,7 @@ gin_extract_jsonb_hash(PG_FUNCTION_ARGS)
439
439
}
440
440
441
441
Datum
442
- gin_extract_jsonb_query_hash (PG_FUNCTION_ARGS )
442
+ gin_extract_jsonb_query_path (PG_FUNCTION_ARGS )
443
443
{
444
444
int32 * nentries = (int32 * )PG_GETARG_POINTER (1 );
445
445
StrategyNumber strategy = PG_GETARG_UINT16 (2 );
@@ -449,9 +449,9 @@ gin_extract_jsonb_query_hash(PG_FUNCTION_ARGS)
449
449
if (strategy != JsonbContainsStrategyNumber )
450
450
elog (ERROR ,"unrecognized strategy number: %d" ,strategy );
451
451
452
- /* Query is a jsonb, so just applygin_extract_jsonb_hash ... */
452
+ /* Query is a jsonb, so just applygin_extract_jsonb_path ... */
453
453
entries = (Datum * )
454
- DatumGetPointer (DirectFunctionCall2 (gin_extract_jsonb_hash ,
454
+ DatumGetPointer (DirectFunctionCall2 (gin_extract_jsonb_path ,
455
455
PG_GETARG_DATUM (0 ),
456
456
PointerGetDatum (nentries )));
457
457
@@ -463,7 +463,7 @@ gin_extract_jsonb_query_hash(PG_FUNCTION_ARGS)
463
463
}
464
464
465
465
Datum
466
- gin_consistent_jsonb_hash (PG_FUNCTION_ARGS )
466
+ gin_consistent_jsonb_path (PG_FUNCTION_ARGS )
467
467
{
468
468
bool * check = (bool * )PG_GETARG_POINTER (0 );
469
469
StrategyNumber strategy = PG_GETARG_UINT16 (1 );
@@ -480,13 +480,12 @@ gin_consistent_jsonb_hash(PG_FUNCTION_ARGS)
480
480
elog (ERROR ,"unrecognized strategy number: %d" ,strategy );
481
481
482
482
/*
483
- *jsonb_hash_ops is necessarily lossy, not only because of hash
483
+ *jsonb_path_ops is necessarily lossy, not only because of hash
484
484
* collisions but also because it doesn't preserve complete information
485
485
* about the structure of the JSON object. Besides, there are some
486
- * special rules around the containment of raw scalar arrays and regular
487
- * arrays that are not handled here. So we must always recheck a match.
488
- * However, if not all of the keys are present, the tuple certainly
489
- * doesn't match.
486
+ * special rules around the containment of raw scalars in arrays that are
487
+ * not handled here. So we must always recheck a match. However, if not
488
+ * all of the keys are present, the tuple certainly doesn't match.
490
489
*/
491
490
* recheck = true;
492
491
for (i = 0 ;i < nkeys ;i ++ )
@@ -502,7 +501,7 @@ gin_consistent_jsonb_hash(PG_FUNCTION_ARGS)
502
501
}
503
502
504
503
Datum
505
- gin_triconsistent_jsonb_hash (PG_FUNCTION_ARGS )
504
+ gin_triconsistent_jsonb_path (PG_FUNCTION_ARGS )
506
505
{
507
506
GinTernaryValue * check = (GinTernaryValue * )PG_GETARG_POINTER (0 );
508
507
StrategyNumber strategy = PG_GETARG_UINT16 (1 );