On Wed, 2006-08-09 at 12:44 -0400, Tom Lane wrote: > A plugin such as a plpgsql debugger would do this in its _PG_init() > function: > > static PLpgSQL_plugin my_plugin = { ... function addresses ... }; > > PLpgSQL_plugin **var_ptr; > > var_ptr = (PLpgSQL_plugin **) find_rendezvous_variable("PLpgSQL_plugin"); > *var_ptr = &my_plugin; > > and this in its _PG_fini() function: > > PLpgSQL_plugin **var_ptr; > > var_ptr = (PLpgSQL_plugin **) find_rendezvous_variable("PLpgSQL_plugin"); > *var_ptr = NULL; > > Meanwhile, plpgsql itself would do this in its _PG_init() function: > > static PLpgSQL_plugin **plugin_ptr = NULL; > > plugin_ptr = (PLpgSQL_plugin **) > find_rendezvous_variable("PLpgSQL_plugin"); > > and in the places where it wants to pass control to the plugin, it'd do > > if (*plugin_ptr) > ((*plugin_ptr)->function_field) (... args ...); >
I know this is a trivial question, but is there some kind of lock that would prevent the PG_fini for the plpgsql debugger from executing after "if(*plugin_ptr)" and before "((*plugin_ptr)->function_field)(...)"? Regards, Jeff Davis ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org