initially immediate 与 initially deferred
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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的主要内容,如果未能解决你的问题,请参考以下文章
Oracle 的 EXECUTE IMMEDIATE 与存储过程中的 LIKE 子句
uwsgi部署相关问题Fatal Python error: Py_Initialize: Unable to get the locale encoding