From 55b5f42adc434b7f7bc83ed9b1023aad8b74311d Mon Sep 17 00:00:00 2001 From: David Wein Date: Fri, 20 Mar 2026 20:01:17 +0000 Subject: [PATCH] Move extension_is_visible_hook from fmgr.h/fmgr.c to extension.h/extension.c --- src/backend/commands/extension.c | 3 +++ src/backend/utils/fmgr/fmgr.c | 1 - src/include/commands/extension.h | 3 +++ src/include/fmgr.h | 3 --- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c index 32621cd22a1..fc17ba250d1 100644 --- a/src/backend/commands/extension.c +++ b/src/backend/commands/extension.c @@ -74,6 +74,9 @@ bool creating_extension = false; Oid CurrentExtensionObject = InvalidOid; +/* Hook for filtering extensions in pg_available_extensions */ +extension_is_visible_hook_type extension_is_visible_hook = NULL; + /* * Internal data structure to hold the results of parsing a control file */ diff --git a/src/backend/utils/fmgr/fmgr.c b/src/backend/utils/fmgr/fmgr.c index 4baddb2c658..a9dd068095b 100644 --- a/src/backend/utils/fmgr/fmgr.c +++ b/src/backend/utils/fmgr/fmgr.c @@ -37,7 +37,6 @@ */ PGDLLIMPORT needs_fmgr_hook_type needs_fmgr_hook = NULL; PGDLLIMPORT fmgr_hook_type fmgr_hook = NULL; -PGDLLIMPORT extension_is_visible_hook_type extension_is_visible_hook = NULL; /* * Hashtable for fast lookup of external C functions diff --git a/src/include/commands/extension.h b/src/include/commands/extension.h index 8a70573834b..fc0f581ab3d 100644 --- a/src/include/commands/extension.h +++ b/src/include/commands/extension.h @@ -54,4 +54,7 @@ extern Oid get_function_sibling_type(Oid funcoid, const char *typname); extern ObjectAddress AlterExtensionNamespace(const char *extensionName, const char *newschema, Oid *oldschema); +typedef bool (*extension_is_visible_hook_type) (const char *extname); +extern PGDLLIMPORT extension_is_visible_hook_type extension_is_visible_hook; + #endif /* EXTENSION_H */ diff --git a/src/include/fmgr.h b/src/include/fmgr.h index f2b22dbf39e..d654047a279 100644 --- a/src/include/fmgr.h +++ b/src/include/fmgr.h @@ -775,9 +775,6 @@ typedef void (*fmgr_hook_type) (FmgrHookEventType event, extern PGDLLIMPORT needs_fmgr_hook_type needs_fmgr_hook; extern PGDLLIMPORT fmgr_hook_type fmgr_hook; -typedef bool (*extension_is_visible_hook_type) (const char *extname); -extern PGDLLIMPORT extension_is_visible_hook_type extension_is_visible_hook; - #define FmgrHookIsNeeded(fn_oid) \ (!needs_fmgr_hook ? false : (*needs_fmgr_hook)(fn_oid))