CREATE OR REPLACE FUNCTION fuzzy_query_func() RETURNS TRIGGER AS $$
BEGIN
INSERT INTO fuzzy_query(id,name,address,table_name) VALUES (new.id, NEW.name,NEW.address,TG_TABLE_NAME);
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION fuzzy_query_update()
RETURNS trigger AS $$
BEGIN
UPDATE fuzzy_query SET name = NEW.name,address = NEW.address where id = NEW.id;
RETURN NEW;
END;
$$
LANGUAGE plpgsql VOLATILE
到此这篇关于Postgresql创建新增、删除与修改触发器的文章就介绍到这了,更多相关Postgresql触发器内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!