SET CONSTRAINTS
This page documents the preview version (v2.21). Preview includes features under active development and is for development and testing only. For production, use the stable version (v2024.1). To learn more, see Versioning.
Synopsis
Use the SET CONSTRAINTS
statement to set the timing of constraint checking within the current transaction.
Syntax
set_constraints ::= SET CONSTRAINTS { ALL | name [ , ... ] }
{ DEFERRED | IMMEDIATE }
Semantics
Attributes in the SET CONSTRAINTS
statement comply with the behavior defined in the SQL standard, except that it does not apply to NOT NULL
and CHECK
constraints.
set_constraints
SET CONSTRAINTS { ALL | *name [ , ... ] } { DEFERRED | IMMEDIATE }
ALL
Change the mode of all deferrable constraints.
name
Specify one or a list of constraint names.
DEFERRED
Set constraints to not be checked until transaction commit.
Uniqueness and exclusion constraints are checked immediately, unless marked DEFERRABLE
.
IMMEDIATE
Set constraints to take effect retroactively.
See also