Column Specific Update Trigger Routine - Mailing list pgsql-sql

From Plugge, Joe R.
Subject Column Specific Update Trigger Routine
Date
Msg-id BD69807DAE0CE44CA00A8338D0FDD08302D2654129@oma00cexmbx03.corp.westworlds.com
Whole thread Raw
In response to Re: How to cascade information like the user roles ?  (Gurjeet Singh <singh.gurjeet@gmail.com>)
List pgsql-sql

I am trying to create a update trigger on a table that basically will only fire when a specific column is updated.  I am using version 8.4.3.

 

My plan of attack was to always fire on any row update, and pass in the OLD and NEW column that I want to check.

 

CREATE TRIGGER check_lockout

    AFTER UPDATE ON acct_table

    FOR EACH ROW

    EXECUTE PROCEDURE acct_unlock(OLD.userid,OLD.ownerid,OLD.password,NEW.password);

 

 

This fails with :

 

[postgres@linux1505 ~]$ cat check_lockout_trig.sql | psql testdb

ERROR:  syntax error at or near "OLD"

LINE 4:     EXECUTE PROCEDURE acct_unlock(OLD.userid,OLD.ownerid,OLD.password,NEW.password);

 

 

What am I doing wrong? Or is there a better way to go about this?

                                          

 

 

pgsql-sql by date:

Previous
From: Leif Biberg Kristensen
Date:
Subject: Re: Need a help in regexp
Next
From: "Plugge, Joe R."
Date:
Subject: Re: Column Specific Update Trigger Routine