If a statement modifies the contents of the database so that an immediate foreign key constraint is in
violation at the conclusion the statement, an exception is thrown and the effects of the statement are
reverted . By contrast, if a statement modifies the contents of the database such that a deferred foreign key
constraint is violated, the violation is not reported immediately. Deferred foreign key constraints are not
checked until the transaction tries to COMMIT. For as long as the user has an open transaction, the database is
allowed to exist in a state that violates any number of deferred foreign key constraints. However, COMMIT will
fail as long as foreign key constraints remain in violation.
If the current statement is not inside an explicit transaction (a BEGIN/COMMIT/ROLLBACK block),
then an implicit transaction is committed as soon as the statement has finished executing.