Re: [COMMITTERS] pgsql: Add a WHEN clause to CREATE TRIGGER, allowing a boolean

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [COMMITTERS] pgsql: Add a WHEN clause to CREATE TRIGGER, allowing a boolean
Дата
Msg-id 603c8f070911201400k2bbf83d3j6fda4f072cdf72d5@mail.gmail.com
обсуждение исходный текст
Ответы Re: [COMMITTERS] pgsql: Add a WHEN clause to CREATE TRIGGER, allowing a boolean
Список pgsql-hackers
On Fri, Nov 20, 2009 at 3:38 PM, Tom Lane <tgl@postgresql.org> wrote:
> Log Message:
> -----------
> Add a WHEN clause to CREATE TRIGGER, allowing a boolean expression to be
> checked to determine whether the trigger should be fired.
>
> For BEFORE triggers this is mostly a matter of spec compliance; but for AFTER
> triggers it can provide a noticeable performance improvement, since queuing of
> a deferred trigger event and re-fetching of the row(s) at end of statement can
> be short-circuited if the trigger does not need to be fired.
>
> Takahiro Itagaki, reviewed by KaiGai Kohei.

Random thought: would it be possible to use something like this to
optimize foreign key constraints, by not firing them if none of the
relevant columns have been updated?

...Robert


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Why do OLD and NEW have special internal names?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Add a WHEN clause to CREATE TRIGGER, allowing a boolean