dbTalk Databases Forums  

Re: Update Row Level Trigger: default value for update trigger

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss Re: Update Row Level Trigger: default value for update trigger in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Manuel Sugawara
 
Posts: n/a

Default Re: Update Row Level Trigger: default value for update trigger - 05-21-2004 , 10:10 AM






Theo Dickinson <Theo.Dickinson (AT) unv (DOT) org> writes:

Quote:
Within an update row level trigger how can I detect which field[s] has been
effected by an update ?
You can compare OLD value with the NEW's one:

IF ( NEW.modified_by <> OLD.modified_by ) THEN
mod_by := 1; -- Use := for assigment

Note that in plpgsql the assigment operator is := and *not* = which
is a boolean operator for equality.

Regards,
Manuel.

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.