Re: Triggers on columns

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "David Fetter" <david(at)fetter(dot)org>, "Itagaki Takahiro" <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Triggers on columns
Date: 2009-09-08 14:38:20
Message-ID: 4AA6260C020000250002AB65@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Fetter <david(at)fetter(dot)org> wrote:

> CREATE TRIGGER trig BEFORE UPDATE ON tbl FOR EACH ROW
> WHEN (NEW.col IS DISTINCT FROM OLD.col)
> EXECUTE PROCEDURE trigger_func();

How much does that buy you versus including this at the start of
trigger_func:

IF (NEW.col IS NOT DISTINCT FROM OLD.col) THEN
RETURN NEW;
END IF;

What about the desire (mentioned up-thread) to test whether a column
was the target of an update SET list within the trigger function?

-Kevin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martin Gainty 2009-09-08 14:41:37 Re: Adding integers ( > 8 bytes) to an inet
Previous Message Tom Lane 2009-09-08 14:25:05 Re: integer input functions : interesting limit behaviour