Initially immediate and initially deferred
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.