postgresql_16:3.2.4.6 Exclusion Constraints
PostgreSQL 16 > The SQL Language > Data Definition > Constraints > Exclusion Constraints
Exclusion constraints ensure that if any two rows are compared on the specified columns or expressions using the specified operators, at least one of these operator comparisons will return false or null. The syntax is: CREATE TABLE circles ( c circle, EXCLUDE USING gist (c WITH &&) );
See also CREATE TABLE ... CONSTRAINT ... EXCLUDE (see sql-createtable-exclude) for details.
Adding an exclusion constraint will automatically create an index of the type specified in the constraint declaration.