Eric Ridge <eeb...@gmail.com> writes: > On Thu, Jun 18, 2015 at 4:42 PM, Andres Freund <and...@anarazel.de> wrote: >> How does your _PG_init() actually look like?
> static ExecutorStart_hook_type prev_ExecutorStartHook = NULL; > static ExecutorEnd_hook_type prev_ExecutorEndHook = NULL; > void _PG_init(void) > { > prev_ExecutorStartHook = ExecutorStart_hook; > prev_ExecutorEndHook = ExecutorEnd_hook; > ExecutorStart_hook = my_executor_start_hook; > ExecutorEnd_hook = my_executor_end_hook; > RegisterXactCallback(my_xact_callback, NULL); > } If that's broken, then so are most of our contrib modules. Certainly none of them have an extra check as suggested by Andres. > As a data point, that might be interesting to know, but I'd still be > scratching my head about how it happened. Postgres doesn't load an > extension library more than once per backend session, does it? It's not supposed to, and AFAICS internal_load_library() will treat either an exact pathname match or an inode-number match as being "already loaded". I wonder if you might be doing something that confuses those checks. It does not look like we try terribly hard to canonicalize library pathnames --- might you have some references under different relative paths, for instance? The inode number check would perhaps fail if you'd installed a new library version, but it's unclear to me why the pathname check would fail. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers