create table canines(lastupdate timestamp with time zone default Now());CREATE OR REPLACE FUNCTION stamp_lastupdate_column() RETURNS TRIGGER AS $$ BEGIN NEW.lastupdate = Now(); RETURN NEW; END; $$language 'plpgsql';CREATE TRIGGER TRG_CANInes_BU BEFORE UPDATE on CANInes FOR EACH ROW EXECUTE PROCEDURE stamp_lastupdate_column();create table dogs(ID int primary key,breed varchar(25)) inherits (CANInes);insert into dogs(ID,breed) values(1,'sheltIE'); select * from dogs;--"2013-02-09 06:49:31.669-05",1,sheltIEupdate dogs set breed = 'SheltIE/Shetland Sheepdog' where ID = 1;select * from dogs;--"2013-02-09 06:49:31.669-05",SheltIE/Shetland Sheepdog长话短说 – 不,它不是遗传的.可以选择CREATE table – liKE … INCLUDING …,但它也不会传播触发器. 总结
以上是内存溢出为你收集整理的PostgreSQL继承:父表触发器是继承的吗?全部内容,希望文章能够帮你解决PostgreSQL继承:父表触发器是继承的吗?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)