本文介绍了NOT DEFERRABLE与DEFERRABLE INITILYY IMMEDIATE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读了关于数据库系统 - 完整书中的SQL关键字 DEFERRABLE

I read this about the SQL keyword DEFERRABLE in Database Systems - The Complete Book.

但是,如果我们声明一个约束为 DEFERRABLE ,那么我们可以选择等待

However, if we declare a constraint to be DEFERRABLE, then we have the option of having it wait until a transaction is complete before checking the constraint.

我们按 DEFERRABLE 关键字 INITIALLY DEFERRED INITIALLY IMMEDIATE 。在前一种情况下,检查将推迟到每个事务提交之前。

We follow the keyword DEFERRABLE by either INITIALLY DEFERRED or INITIALLY IMMEDIATE. In the former case, checking will be deferred to just before each transaction commits. In the latter case, the check will be made immediately after each statement.

如何 NOT DEFERRABLE 不同于 DEFERRABLE INITILYY IMMEDIATE

推荐答案

使用 DEFERRABLE INITIALLY IMMEDIATE ,您可以根据需要延迟约束。

With DEFERRABLE INITIALLY IMMEDIATE you can defer the constraints on demand when you need it.

如果您通常希望在语句时检查约束,那么这将非常有用。

This is useful if you normally want to check the constraints at statement time, but for e.g. a batch load want to defer the checking until commit time.

尽管

使用 NOT DEFERRABLE ,您将永远无法延迟检查,直到提交时间。

With NOT DEFERRABLE you will never ever be able to defer the checking until commit time.

这篇关于NOT DEFERRABLE与DEFERRABLE INITILYY IMMEDIATE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 05:20