From: | Jamie Deppeler <jamie(at)doitonce(dot)net(dot)au> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | update problem in triggers |
Date: | 2005-09-20 01:01:45 |
Message-ID: | 432F5F79.70703@doitonce.net.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I am having with this simple trigger i wrote, worked when i created it
but now i get this error "Stack depth Limit Exceeded"
If someone could tell me what i am doing wrong i would be greatfull
Trigger
CREATE TRIGGER "updateKeys" AFTER UPDATE
ON "projects"."resource" FOR EACH ROW
EXECUTE PROCEDURE "projects"."setParentKeysResourceUpdate"();
Function
CREATE OR REPLACE FUNCTION "projects"."setParentKeysResourceUpdate" ()
RETURNS trigger AS
$body$
declare
projectcursor refCursor;
prop RECORD;
begin
if new.fkproject is null then
open projectcursor FOR SELECT * from projects.component
WHERE projects.component."primary" = new.fkcomponent;
FETCH projectcursor into prop;
update projects.resource set fkproject = prop.fkproject,
fkproposition = prop.fkproposition, fkjob = prop.fkjob where
projects.resource."primary" = new."primary";
close projectcursor;
end if;
return null;
end;
$body$
LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;
From | Date | Subject | |
---|---|---|---|
Next Message | Neil Dugan | 2005-09-20 01:54:49 | Re: help me pls |
Previous Message | Bruce Momjian | 2005-09-20 00:44:13 | Re: CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT |