Re: [v9.3] OAT_POST_ALTER object access hooks

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: [v9.3] OAT_POST_ALTER object access hooks
Дата
Msg-id 20121119223239.GF4196@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: [v9.3] OAT_POST_ALTER object access hooks  (Kohei KaiGai <kaigai@kaigai.gr.jp>)
Ответы Re: [v9.3] OAT_POST_ALTER object access hooks  (Kohei KaiGai <kaigai@kaigai.gr.jp>)
Список pgsql-hackers
Kohei KaiGai wrote:
> Sorry, I missed the attached version.
> Please use this revision.

All those direct uses of object_access_hook make me think that the
InvokeObjectAccessHook() macro we have is insufficient.  Maybe we could
have InvokeObjectAccessHookArg1() so that instead of

+   if (object_access_hook)
+   {
+       ObjectAccessPostCreate  pc_arg;
+
+       memset(&pc_arg, 0, sizeof(ObjectAccessPostCreate));
+       pc_arg.is_internal = is_internal;
+       (*object_access_hook)(OAT_POST_CREATE, AttrDefaultRelationId,
+                             RelationGetRelid(rel), attnum, (void *)&pc_arg);
+   }

we can have
InvokeObjectAccessHookWithArgs1(OAT_POST_CREATE, AttrDefaultRelationId,                RelationGetRelid(rel), attnum,
            ObjectAccessPostCreate, is_internal, is_internal) 

which would expand into the above.  (Since ObjectAccessPostCreate has
two members, we presumably need InvokeObjectAccessHookWithArgs2 as
well.  But that doesn't seem to be used anywhere, so maybe that struct
member is not necessary?)

The second hunk to alter.c does not apply anymore; please rebase.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



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

Предыдущее
От: Alexander Korotkov
Дата:
Сообщение: Re: WIP: index support for regexp search
Следующее
От: "Erik Rijkers"
Дата:
Сообщение: Re: WIP: index support for regexp search