UPDATE keyword - Mailing list pgsql-general

From Ian Harding
Subject UPDATE keyword
Date
Msg-id sb0e855f.087@mail.tpchd.org
Whole thread Raw
Responses Re: UPDATE keyword  (will trillich <will@serensoft.com>)
List pgsql-general
Well, I am making progress in rewriting my MSSQL Server T-SQL triggers and stored procedures in Pl/Tcl.  However, I
haverun into a bit of an issue and I wonder if anyone knows the best way to address it... 

In T-SQL triggers, you can use the UPDATE keyword in conditional expressions as in

IF UPDATE(myfield)
BEGIN
    do something
END

It detects the update of the field.  I have been comparing $NEW(myfield) and $OLD(myfield) which works ok, except where
Iused the UPDATE() test as a crutch.  I sometimes do an update like 

UPDATE mytable SET myfield = myfield WHERE...

to fire an update trigger, and executing only the code in that trigger surrounded by UPDATE(myfield).

Is there an easy way to duplicate this, or should I work around it?

Ian A. Harding
Programmer/Analyst II
Tacoma-Pierce County Health Department
(253) 798-3549
mailto: ianh@tpchd.org


pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Weird query execution paths, ignoring indexes...
Next
From: Justin Clift
Date:
Subject: Re: Compilation fails --with-ssl on Solaris 8