Search Postgresql Archives

update problem in triggers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux