update po_details_master
set isactive = True
ERROR: control reached end of trigger procedure without RETURN
CONTEXT: PL/pgSQL function action_timestamp_column()
SQL state: 2F005
触发
CREATE OR REPLACE FUNCTION action_timestamp_column()
RETURNS TRIGGER
SET SCHEMA 'public'
LANGUAGE plpgsql
SET search_path = public
AS '
BEGIN
END;
';
CREATE TRIGGER action_timestamp_column BEFORE UPDATE
ON po_details_master FOR EACH ROW EXECUTE PROCEDURE
action_timestamp_column();
答案 0 :(得分:0)
您的触发功能无效。触发函数必须返回某些内容。
触发器函数必须返回NULL或具有精确触发表的结构的记录/行值。
在行触发之前,行级触发器可以返回null,以指示触发器管理器跳过该行的其余操作
所以什么都不做的触发函数的最低版本是:
CREATE OR REPLACE FUNCTION action_timestamp_column()
RETURNS TRIGGER
SET SCHEMA 'public'
LANGUAGE plpgsql
SET search_path = public
AS $body$
BEGIN
return new; --<< this is missing in your trigger and causes the error.
END;
$body$
;