Re: Coming from Oracle - trigger question

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Coming from Oracle - trigger question
Дата
Msg-id 11490.1024579836@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Coming from Oracle - trigger question  ("Graeme Merrall" <gbmerrall@aol.com>)
Список pgsql-general
"Graeme Merrall" <gbmerrall@aol.com> writes:
> The function below will update the 'dirty' column as long as you're not
> performing an operation on the 'dirty' as part of your SQL statement

> CREATE OR REPLACE TRIGGER before_nodes_update
> before update on nodes
> for each row
> begin
>     if not updating('DIRTY') then

Hmm.  The usual locution in Postgres is more like

    if old.foo != new.foo then ...

Is that close enough to do what you want?

            regards, tom lane

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

Предыдущее
От: Shaun Thomas
Дата:
Сообщение: Re: db grows and grows
Следующее
От: Jeff Eckermann
Дата:
Сообщение: Re: how to evaluate a function only once for a query?