且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PostgreSQL函数和触发器

更新时间:2022-12-17 19:31:52

错误消息告诉大家.您需要通过触发功能执行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或具有准确触发触发器的表结构的记录/行值.