Re: Label switcher function

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Label switcher function
Дата
Msg-id AANLkTimex+C78vaPZm71QsCmfwX9kgycqb-eN0HqOHdE@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Label switcher function  (KaiGai Kohei <kaigai@ak.jp.nec.com>)
Ответы Re: Label switcher function  (KaiGai Kohei <kaigai@ak.jp.nec.com>)
Список pgsql-hackers
2010/11/25 KaiGai Kohei <kaigai@ak.jp.nec.com>:
> The attached patch is a revised one.
>
> It provides two hooks; the one informs core PG whether the supplied
> function needs to be hooked, or not. the other is an actual hook on
> prepare, start, end and abort of function invocations.
>
>  typedef bool (*needs_function_call_type)(Oid fn_oid);
>
>  typedef void (*function_call_type)(FunctionCallEventType event,
>                                     FmgrInfo *flinfo, Datum *private);
>
> The hook prototype was a bit modified since the suggestion from
> Robert. Because FmgrInfo structure contain OID of the function,
> it might be redundant to deliver OID of the function individually.
>
> Rest of parts are revised according to the comment.
>
> I also fixed up source code comments which might become incorrect.

FCET_PREPARE looks completely unnecessary to me.  Any necessary
one-time work can easily be done at FCET_START time, assuming that the
private-data field is initialized to (Datum) 0.

I'm fairly certain that the following is not portable:

+       ObjectAddress   object = { .classId = ProcedureRelationId,
+                                                          .objectId = fn_oid,
+                                                          .objectSubId = 0 };

I'd suggest renaming needs_function_call_type and function_call_type
to needs_fmgr_hook_type and fmgr_hook_type.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: "David E. Wheeler"
Дата:
Сообщение: Re: Per-column collation
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: profiling connection overhead