From 8d8bb1f554f45623a1bd5b3b5223490d5bfc818b Mon Sep 17 00:00:00 2001 From: Tim Chang Date: Wed, 17 Jan 2024 19:28:22 +0000 Subject: [PATCH] Add simple fetch for VAR_OID_PREFETCH --- src/backend/access/transam/varsup.c | 8 ++++++++ src/include/access/transam.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/backend/access/transam/varsup.c b/src/backend/access/transam/varsup.c index dd3d7498250..ad39a029332 100644 --- a/src/backend/access/transam/varsup.c +++ b/src/backend/access/transam/varsup.c @@ -590,6 +590,14 @@ GetNewObjectId(void) return result; } +/* + * Simple function to get VAR_OID_PREFETCH when needed outside of this file. + */ +int GetVarOidPrefetch(void) +{ + return VAR_OID_PREFETCH; +} + /* * SetNextObjectId * diff --git a/src/include/access/transam.h b/src/include/access/transam.h index 45bc724ce88..300f76629aa 100644 --- a/src/include/access/transam.h +++ b/src/include/access/transam.h @@ -301,6 +301,8 @@ extern bool ForceTransactionIdLimitUpdate(void); extern Oid GetNewObjectId(void); extern void StopGeneratingPinnedObjectIds(void); +extern int GetVarOidPrefetch(void); + typedef void (*GetNewObjectId_hook_type) (VariableCache variableCache); extern PGDLLIMPORT GetNewObjectId_hook_type GetNewObjectId_hook;