Re: Coming from Oracle - trigger question - Mailing list pgsql-general

From Tom Lane
Subject Re: Coming from Oracle - trigger question
Date
Msg-id 11490.1024579836@sss.pgh.pa.us
Whole thread Raw
In response to Coming from Oracle - trigger question  ("Graeme Merrall" <gbmerrall@aol.com>)
List 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 by date:

Previous
From: Shaun Thomas
Date:
Subject: Re: db grows and grows
Next
From: Jeff Eckermann
Date:
Subject: Re: how to evaluate a function only once for a query?