triggers using row values

From: Clarence Gardner <clarence(at)silcom(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: triggers using row values
Date: 2003-04-03 19:16:32
Message-ID: Pine.LNX.4.44.0304031112140.24338-100000@liberty.sba2.netlojix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I'm trying to create a trigger which will pass a value from the row
into the procedure to execute. All the documentation I can find shows
only constant arguments being passed. For example,
CREATE TRIGGER if_dist_exists
BEFORE INSERT OR UPDATE ON films FOR EACH ROW
EXECUTE PROCEDURE check_primary_key ('did', 'distributors', 'did');

That doesn't seem very useful. Here's what I'm trying:
netbill=> create trigger set_stale_1
netbill-> after insert or update or delete on dns_a for each row
netbill-> execute procedure set_zone_stale(zid);
ERROR: CreateTrigger: function set_zone_stale() does not exist

I have a function defined as set_zone_stale(int). How can I call
it using the zid field from the changed record?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2003-04-03 19:16:55 Re: [GENERAL] Suggestion
Previous Message Vlad Krupin 2003-04-03 19:11:50 Re: 'DROP INDEX' kills stored rpocedures