Skip to content

Commit

Permalink
Remove non-functional code for module unloading
Browse files Browse the repository at this point in the history
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
  • Loading branch information
michaelpq committed Aug 20, 2024
1 parent 0c08be4 commit 3c0464f
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions pg_hint_plan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 3c0464f

Please sign in to comment.