首页 > 代码库 > initially immediate 与 initially deferred
initially immediate 与 initially deferred
initially immediate 初始化立即执行.
initially deferred 初始化延迟执行.
表约束定义:
[ CONSTRAINT name ] { PRIMARY KEY constraint | FOREIGN KEY constraint | UNIQUE constraint | CHECK constraint } [ {INITIALLY DEFERRED | INITIALLY IMMEDIATE} ] [ [ NOT ] DEFERRABLE ]
列约束定义:
[ CONSTRAINT name ] { NOT NULL constraint | PRIMARY KEY constraint | FOREIGN KEY constraint | UNIQUE constraint | CHECK constraint } [ {INITIALLY DEFERRED | INITIALLY IMMEDIATE} ] [ [ NOT ] DEFERRABLE ]
一个 CONSTRAINT (约束)定义可以包含一个任意顺序的延迟属性的子句和/或一个初始化约束式子句.
NOT DEFERRABLE
意味着每条 SQL 语句执行后都必须校验是否违反约束规则.
DEFERRABLE
意味着约束的校验可以推迟到晚些时候,但不晚于当前事务的结束.
事务开始时,每个约束会为每个约束的模式设置一个初始值.
INITIALLY IMMEDIATE
意味着,当事务开始时,每个 SQL 语句执行后都必须检查是否违反了约束规则.
INITIALLY DEFERRED
意味着,当事务开始后,对约束的检查可以推迟到晚些时候,但不晚于当前事务的结束.
initially immediate 与 initially deferred
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。