Re: security hooks on object creation

From: KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: security hooks on object creation
Date: 2010-11-10 22:41:11
Message-ID: 4CDB1F87.2020905@kaigai.gr.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

(2010/11/11 3:00), Robert Haas wrote:
> On Wed, Nov 10, 2010 at 8:33 AM, KaiGai Kohei<kaigai(at)kaigai(dot)gr(dot)jp> wrote:
>> (2010/11/10 13:06), Robert Haas wrote:
>>>>
>>>> In this patch, we put InvokeObjectAccessHook0 on the following functions.
>>>>
>>>> - heap_create_with_catalog() for relations/attributes
>>>> - ATExecAddColumn() for attributes
>>>> - NamespaceCreate() for schemas
>>>> - ProcedureCreate() for aggregates/functions
>>>> - TypeCreate() and TypeShellMake() for types
>>>> - create_proc_lang() for procedural languages
>>>> - inv_create() for large objects
>>>
>>> I think you ought to try to arrange to avoid the overhead of a
>>> function call in the common case where nobody's using the hook.
>>> That's why I originally suggested making InvokeObjectAccessHook() a
>>> macro around the actual function call.
>>>
>> Hmm. Although I have little preference here, the penalty to call
>> an empty function (when no plugins are installed) is not visible,
>> because frequency of DDL commands are not high.
>> Even so, is it necessary to replace them by macros?
>
> It's a fair point. I'm open to other opinions but my vote is to shove
> a macro in there. A pointer test is cheaper than a function call, and
> doesn't really complicate things much.
>
Since I have no strong preference function call here, so, I'll revise my
patch according to your vote.

Thanks,
--
KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-11-10 22:49:50 Re: B-tree parent pointer and checkpoints
Previous Message David E. Wheeler 2010-11-10 22:39:04 Re: multi-platform, multi-locale regression tests