我有一个如下的桌队
Name pin time
SAS -1 12-02-2019
我下面有触发器,触发器函数具有pg_sleep函数
CREATE TRIGGER loc_changer
AFTER UPDATE OF pin ON teams
FOR EACH ROW
EXECUTE PROCEDURE changes();
CREATE FUNCTION changes()
RETURNS trigger AS
$BODY$
BEGIN
IF NEW.pin <> '-1' THEN
PERFORM pg_sleep(30);
UPDATE teams SET pin = '-1' where old.name=new.name;
END IF;
RETURN NEW;
END;
$BODY$ LANGUAGE plpgsql;
问题:在触发器执行期间,我在Postgres数据库中看不到新的列值。