标签:cti return null UNC priority and set code end
CREATE FUNCTION reorder_priority() RETURNS TRIGGER AS $$ BEGIN CASE TG_OP WHEN ‘UPDATE‘ THEN UPDATE link SET priority = priority + 1 WHERE link.priority >= NEW.priority AND NOT link.priority > OLD.priority; END CASE; RETURN NULL; END; $$ LANGUAGE plpgsql;
正确解法
BEGIN
CASE TG_OP
WHEN ‘UPDATE‘ THEN
UPDATE
link
SET
priority = priority + 1
WHERE
link.priority >= NEW.priority AND
NOT link.priority >= OLD.priority;
END CASE;
RETURN NEW;
END;
标签:cti return null UNC priority and set code end
原文地址:https://www.cnblogs.com/gamecenter/p/11368029.html