更新时间:2022-12-17 19:40:39
错误信息告诉你一切.你需要从触发器函数中做一个 RETURN :
The error message tells you all. You need to do a RETURN from the trigger function:
CREATE OR REPLACE FUNCTION forest_aud_func() returns trigger as $tree_stamp$
BEGIN
insert into Audit values('k',124,'l');
return new;
END;
$tree_stamp$
LANGUAGE plpgsql;
来自手册:
触发器函数必须返回 NULL 或记录/行值,该值与触发触发器的表的结构完全相同.