Re: Label switcher function
От | KaiGai Kohei |
---|---|
Тема | Re: Label switcher function |
Дата | |
Msg-id | 4CFDFAE0.4010301@ak.jp.nec.com обсуждение исходный текст |
Ответ на | Re: Label switcher function (Robert Haas <robertmhaas@gmail.com>) |
Ответы |
Re: Label switcher function
|
Список | pgsql-hackers |
Thanks for your reviewing. The attached patch is a revised version. I don't have any objections to your comments. (2010/12/07 4:38), Robert Haas wrote: > 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. > It seems to me a reasonable assumption. I revised the code, and modified source code comments to ensure the private shall be initialized to (Datum) 0. > I'm fairly certain that the following is not portable: > > + ObjectAddress object = { .classId = ProcedureRelationId, > + .objectId = fn_oid, > + .objectSubId = 0 }; > Fixed. > I'd suggest renaming needs_function_call_type and function_call_type > to needs_fmgr_hook_type and fmgr_hook_type. > I also think the suggested names are better than before. According to the renaming, FunctionCallEventType was also renamed to FmgrHookEventType. Perhaps, it is a reasonable change. Thanks, -- KaiGai Kohei <kaigai@ak.jp.nec.com>
Вложения
В списке pgsql-hackers по дате отправления: