以下就是我的触发器,望高人帮我看下,是触发器有错,还是其他什么问题?
我在网上看到是说改下“max_stack_depth = 2MB”这个,可我改成4M了,还是报错啊?-- Function: auto_i_sy()-- DROP FUNCTION auto_i_sy();CREATE OR REPLACE FUNCTION auto_i_sy()
RETURNS trigger AS
$BODY$
DECLARE
vsalaryid bigint ;
BEGINselect sum(sy.salaryid) into vsalaryid from tsalary sy where sy.yueFen=NEW.zhangQi and sy.enterpriseid=NEW.enterpriseid AND sy.staffid=NEW.staffid;
update tinsurance set salaryid=vsalaryid where enterpriseid=NEW.enterpriseid AND staffid=NEW.staffid and zhangQi=NEW.zhangQi;
return null;
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE
COST 100;
ALTER FUNCTION auto_i_sy() OWNER TO postgres;
我在网上看到是说改下“max_stack_depth = 2MB”这个,可我改成4M了,还是报错啊?-- Function: auto_i_sy()-- DROP FUNCTION auto_i_sy();CREATE OR REPLACE FUNCTION auto_i_sy()
RETURNS trigger AS
$BODY$
DECLARE
vsalaryid bigint ;
BEGINselect sum(sy.salaryid) into vsalaryid from tsalary sy where sy.yueFen=NEW.zhangQi and sy.enterpriseid=NEW.enterpriseid AND sy.staffid=NEW.staffid;
update tinsurance set salaryid=vsalaryid where enterpriseid=NEW.enterpriseid AND staffid=NEW.staffid and zhangQi=NEW.zhangQi;
return null;
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE
COST 100;
ALTER FUNCTION auto_i_sy() OWNER TO postgres;
AFTER INSERT OR UPDATE
ON tinsurance
FOR EACH ROW
EXECUTE PROCEDURE auto_i_sy();