Get the App
SLTechnology News&Howtos  ›  Database  › 

Initially immediate and initially deferred

Shulou Source: shulou.com Published: 2022-06-01 16:29:11 10月02日 Update

initially immediately execute.initially delayed execution. Table constraint definition: [ CONSTRAINT name ] { PRIMARY KEY constraint | FOREIGN KEY constraint | UNIQUE constraint | CHECK constraint } [ {INITIALLY DEFERRED | INITIALLY IMMEDIATE} ] [ [ NOT ] DEFERRABLE ] Column constraint definition: [ CONSTRAINT name ] { NOT NULL constraint | PRIMARY KEY constraint | FOREIGN KEY constraint | UNIQUE constraint | CHECK constraint } [ {INITIALLY DEFERRED | INITIALLY IMMEDIATE} ] [ [ NOT ] DEFERRABLE ] A CONSTRAINT definition can contain a clause with delay attributes in any order and/or an initialization constraint clause.

NOT DEFERRABLE

This means that every SQL statement executed must be checked for constraint violations.

DEFERRABLE

Means that constraint validation can be deferred until later, but no later than the end of the current transaction.

At the beginning of a transaction, each constraint sets an initial value for the pattern of each constraint.

INITIALLY IMMEDIATE

This means that when a transaction begins, every SQL statement must be checked for constraint violations after execution.

INITIALLY DEFERRED

This means that when a transaction starts, checking constraints can be deferred until later, but no later than the end of the current transaction.

Tags: Transaction meaning clause time rule statement delay check attribute pattern order Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Apple Linux MariaDB Xiaomi