Re: Weirdness using Executor Hooks

From: Andres Freund <andres(at)anarazel(dot)de>
To: Eric Ridge <eebbrr(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Weirdness using Executor Hooks
Date: 2015-06-18 20:42:23
Message-ID: 20150618204223.GE29350@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2015-06-18 16:36:17 -0400, Eric Ridge wrote:
> I've written an extension that hooks ExecutorStart_hook and
> ExecutorEnd_hook. The hooks are assigned in _PG_init() (and the previous
> ones saved to static vars) and reset to the previous values in _PG_fini().
> Maybe also of interest is the extension library is set in postgresql.conf
> as a local_preload_libraries. This is with Postgres 9.3.4.

How does your _PG_init() actually look like?

I'd suggest adding an error check that prev_ExecutorStartHook is
unequals to your function when you assign it.

> What happens is that rarely (and of course never on my development
> machine), the saved "prev_ExecutorXXXHook" gets set to the current value of
> ExecutorXXX_hook, so when my hook function is called:

Did you check whether it's compiler/compiler flag dependant?

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Eric Ridge 2015-06-18 20:54:31 Re: Weirdness using Executor Hooks
Previous Message Eric Ridge 2015-06-18 20:36:17 Weirdness using Executor Hooks