Re: Coming from Oracle - trigger question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Graeme Merrall" <gbmerrall(at)aol(dot)com>
Cc: "Pgsql-General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Coming from Oracle - trigger question
Date: 2002-06-20 13:30:36
Message-ID: 11490.1024579836@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Graeme Merrall" <gbmerrall(at)aol(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Eckermann 2002-06-20 13:45:09 Re: how to evaluate a function only once for a query?
Previous Message Shaun Thomas 2002-06-20 13:26:10 Re: db grows and grows