From 3c0464f8897499aa033b15bd4dbadde831809213 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Tue, 20 Aug 2024 13:39:07 +0900 Subject: [PATCH] Remove non-functional code for module unloading Upstream never had support for library unloading, and it has been officially simplified in ab02d702ef08. Let's do the same for pg_hint_plan, to shave some code. Backpatch-through: 17 --- pg_hint_plan.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/pg_hint_plan.c b/pg_hint_plan.c index c59ebba..779d3ae 100644 --- a/pg_hint_plan.c +++ b/pg_hint_plan.c @@ -415,7 +415,6 @@ static void assign_enable_hint_table(bool newval, void *extra); /* Module callbacks */ void _PG_init(void); -void _PG_fini(void); static void push_hint(HintState *hstate); static void pop_hint(void); @@ -791,28 +790,6 @@ _PG_init(void) ExecutorEnd_hook = pg_hint_ExecutorEnd; } -/* - * Module unload callback - * XXX never called - */ -void -_PG_fini(void) -{ - PLpgSQL_plugin **var_ptr; - - /* Uninstall hooks. */ - planner_hook = prev_planner; - join_search_hook = prev_join_search; - set_rel_pathlist_hook = prev_set_rel_pathlist; - needs_fmgr_hook = prev_needs_fmgr_hook; - fmgr_hook = prev_fmgr_hook; - ExecutorEnd_hook = prev_ExecutorEnd; - - /* uninstall PL/pgSQL plugin hook */ - var_ptr = (PLpgSQL_plugin **) find_rendezvous_variable("PLpgSQL_plugin"); - *var_ptr = NULL; -} - static bool enable_hint_table_check(bool *newval, void **extra, GucSource source) {