Re: sql_drop Event Trigger

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: sql_drop Event Trigger
Дата
Msg-id m2r4ktlfq6.fsf@2ndQuadrant.fr
обсуждение исходный текст
Ответ на Re: sql_drop Event Trigger  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> Hmm, quoth
> http://www.postgresql.org/message-id/23345.1358476518@sss.pgh.pa.us :
>
>> I'd really like to get to a point where we can
>> define things as happening like this:
>> 
>>       * collect information needed to interpret the DDL command
>>         (lookup and lock objects, etc)
>>       * fire "before" event triggers, if any (and if so, recheck info)
>>       * do the command
>>       * fire "after" event triggers, if any
>
> Note that in the snippet I posted above objects have already been looked
> up and locked (first phase above).

Ok, I like what you did, but what you did is reinstall the "sql_drop"
event and is not complete, as you mention we have some hard problems to
solve there.

> But I don't think "code structure convenience" is the only reason to do
> things this way instead of postponing firing the trigger until the end.
> I think complete support for drop event triggers really needs to have
> the objects to be dropped still in catalogs, so that they can be looked
> up; for instance, user code might want to check the names of the
> columns and take particular actions if particular names or particular
> types are present.  That doesn't seem an easy thing to do if all you get
> is pg_dropped_objects(), because how do you know which columns belong to
> which tables?

Agreed.

In terms of Robert's reviewing, though, I think you're talking about
another patch entirely, that will get worked on in the 9.4 cycle.

And in my terms, doing all that work now is useless anyway because we
are not exposing any object specific information that allow the user to
do any actual catalog lookup anyway, yet.

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support



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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Facing authentication error on postgres 9.2 -> dblink functions
Следующее
От: Robert Haas
Дата:
Сообщение: Re: sql_drop Event Trigger