Re: Weirdness using Executor Hooks

Поиск
Список
Период
Сортировка
От Eric Ridge
Тема Re: Weirdness using Executor Hooks
Дата
Msg-id CANcm6wbq99Y0RrfcrNpJqgx1YoMD_ss1snDmjjt7gu9O174UsQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Weirdness using Executor Hooks  (Andres Freund <andres@anarazel.de>)
Ответы Re: Weirdness using Executor Hooks
Список pgsql-hackers
On Thu, Jun 18, 2015 at 4:42 PM, Andres Freund <andres@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);
}

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

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?

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

I didn't.  As far as compiler flags go, the extension is just
inheriting Postgres' defaults.  Any suggestions around which flag(s)
to adjust?

I appreciate your time!

eric



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Weirdness using Executor Hooks
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Is it possible to have a "fast-write" Index?