diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c
index 2dbc2151b1..48a8a14c7f 100644
--- a/src/backend/utils/cache/catcache.c
+++ b/src/backend/utils/cache/catcache.c
@@ -72,11 +72,16 @@ static CatCacheHeader *CacheHdr = NULL;
 /* Clock for the last accessed time of a catcache entry. */
 TimestampTz	catcacheclock = 0;
 
-static inline HeapTuple SearchCatCacheInternal(CatCache *cache,
+static HeapTuple SearchCatCacheInternalb(CatCache *cache,
 											   int nkeys,
 											   Datum v1, Datum v2,
 											   Datum v3, Datum v4);
 
+static HeapTuple (*SearchCatCacheInternal)(CatCache *cache,
+											   int nkeys,
+											   Datum v1, Datum v2,
+											   Datum v3, Datum v4) =
+	SearchCatCacheInternalb;
 static pg_noinline HeapTuple SearchCatCacheMiss(CatCache *cache,
 												int nkeys,
 												uint32 hashValue,
@@ -1245,7 +1250,7 @@ SearchCatCache4(CatCache *cache,
  * Work-horse for SearchCatCache/SearchCatCacheN.
  */
 static inline HeapTuple
-SearchCatCacheInternal(CatCache *cache,
+SearchCatCacheInternalb(CatCache *cache,
 					   int nkeys,
 					   Datum v1,
 					   Datum v2,