@@ -81,9 +81,9 @@ refresh_pathman_relation_info(Oid relid,
8181Datum param_values [Natts_pathman_config_params ];
8282bool param_isnull [Natts_pathman_config_params ];
8383
84- prel = (PartRelationInfo * )hash_search (partitioned_rels ,
85- ( const void * ) & relid ,
86- HASH_ENTER , & found_entry );
84+ prel = (PartRelationInfo * )pathman_cache_search_relid (partitioned_rels ,
85+ relid , HASH_ENTER ,
86+ & found_entry );
8787elog (DEBUG2 ,
8888found_entry ?
8989"Refreshing record for relation %u in pg_pathman's cache [%u]" :
@@ -239,9 +239,9 @@ invalidate_pathman_relation_info(Oid relid, bool *found)
239239HASHACTION action = found ?HASH_FIND :HASH_ENTER ;
240240PartRelationInfo * prel ;
241241
242- prel = hash_search (partitioned_rels ,
243- ( const void * ) & relid ,
244- action , & prel_found );
242+ prel = pathman_cache_search_relid (partitioned_rels ,
243+ relid , action ,
244+ & prel_found );
245245
246246if ((action == HASH_FIND ||
247247(action == HASH_ENTER && prel_found ))&& PrelIsValid (prel ))
@@ -272,10 +272,9 @@ invalidate_pathman_relation_info(Oid relid, bool *found)
272272const PartRelationInfo *
273273get_pathman_relation_info (Oid relid )
274274{
275- const PartRelationInfo * prel = hash_search (partitioned_rels ,
276- (const void * )& relid ,
277- HASH_FIND ,NULL );
278-
275+ const PartRelationInfo * prel = pathman_cache_search_relid (partitioned_rels ,
276+ relid ,HASH_FIND ,
277+ NULL );
279278/* Refresh PartRelationInfo if needed */
280279if (prel && !PrelIsValid (prel ))
281280{
@@ -345,20 +344,19 @@ get_pathman_relation_info_after_lock(Oid relid,
345344void
346345remove_pathman_relation_info (Oid relid )
347346{
348- PartRelationInfo * prel = hash_search (partitioned_rels ,
349- ( const void * ) & relid ,
350- HASH_FIND , NULL );
351- if (prel && PrelIsValid (prel ))
347+ PartRelationInfo * prel = pathman_cache_search_relid (partitioned_rels ,
348+ relid , HASH_FIND ,
349+ NULL );
350+ if (PrelIsValid (prel ))
352351{
353352/* Free these arrays iff they're not NULL */
354353FreeChildrenArray (prel );
355354FreeRangesArray (prel );
356355}
357356
358357/* Now let's remove the entry completely */
359- hash_search (partitioned_rels ,
360- (const void * )& relid ,
361- HASH_REMOVE ,NULL );
358+ pathman_cache_search_relid (partitioned_rels ,relid ,
359+ HASH_REMOVE ,NULL );
362360
363361elog (DEBUG2 ,
364362"Removing record for relation %u in pg_pathman's cache [%u]" ,
@@ -509,10 +507,10 @@ cache_parent_of_partition(Oid partition, Oid parent)
509507bool found ;
510508PartParentInfo * ppar ;
511509
512- ppar = hash_search (parent_cache ,
513- ( const void * ) & partition ,
514- HASH_ENTER ,& found );
515-
510+ ppar = pathman_cache_search_relid (parent_cache ,
511+ partition ,
512+ HASH_ENTER ,
513+ & found );
516514elog (DEBUG2 ,
517515found ?
518516"Refreshing record for child %u in pg_pathman's cache [%u]" :
@@ -551,10 +549,10 @@ get_parent_of_partition_internal(Oid partition,
551549{
552550const char * action_str ;/* "Fetching"\"Resetting" */
553551Oid parent ;
554- PartParentInfo * ppar = hash_search (parent_cache ,
555- ( const void * ) & partition ,
556- HASH_FIND ,NULL );
557-
552+ PartParentInfo * ppar = pathman_cache_search_relid (parent_cache ,
553+ partition ,
554+ HASH_FIND ,
555+ NULL );
558556/* Set 'action_str' */
559557switch (action )
560558{
@@ -581,9 +579,8 @@ get_parent_of_partition_internal(Oid partition,
581579
582580/* Remove entry if necessary */
583581if (action == HASH_REMOVE )
584- hash_search (parent_cache ,
585- (const void * )& partition ,
586- HASH_REMOVE ,NULL );
582+ pathman_cache_search_relid (parent_cache ,partition ,
583+ HASH_REMOVE ,NULL );
587584}
588585/* Try fetching parent from syscache if 'status' is provided */
589586else if (status )