Re: Triggers on columns

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Triggers on columns
Дата
Msg-id 603c8f070909021915y4a5cfad4lc58f2e885e47f7e2@mail.gmail.com
обсуждение исходный текст
Ответ на Triggers on columns  (Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
Ответы Re: Triggers on columns  (Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
Re: Triggers on columns  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
On Wed, Sep 2, 2009 at 9:52 PM, Itagaki
Takahiro<itagaki.takahiro@oss.ntt.co.jp> wrote:
> Here is a patch to implement "Support triggers on columns" in our ToDo list.
>
> The syntax is:
>    CREATE TRIGGER name
>        BEFORE UPDATE OF col1, col12, ...
>        ON tbl FOR EACH ROW EXECUTE PROCEDURE func();
>
> I consulted the previous work following:
>    Column-level triggers (From: Greg Sabino Mullane, Date: 2005-07-04)
>    http://archives.postgresql.org/pgsql-patches/2005-07/msg00107.php
> and completed some under-construction parts.
>
> It's still arguable that we should add dependencies from column
> triggers to referenced columns. In the present patch, dropeed
> columns are just ignored and always considered as not-modified.
> Please grep with "TODO: (TRIGGER)" to check the issue.
>
> Comments welcome.

Wow, so I wouldn't have to do this any more?

IF (TG_OP = 'UPDATE') THEN   IF (OLD.foo IS NOT DISTINCT FROM NEW.foo AND OLD.bar IS NOT
DISTINCT FROM NEW.bar        AND OLD.baz IS NOT DISTINCT FROM NEW.baz) THEN       RETURN NULL;   END IF;
END IF;

Apart from any possible gain in efficiency, the sheer savings in
typing sound quite awesome.

...Robert


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Schedule for 8.5 Development
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Schedule for 8.5 Development