Update SET CONSTRAINTS reference page --- it failed to mention EXCLUDE
authorTom Lane
Mon, 18 Jan 2010 00:32:21 +0000 (00:32 +0000)
committerTom Lane
Mon, 18 Jan 2010 00:32:21 +0000 (00:32 +0000)
constraints and was lacking a couple of other interesting details.

doc/src/sgml/ref/set_constraints.sgml

index e03910e2529b4d9d8256f99d6eb711cc0f61171e..94c2ecabc72e9a6c59c6b43bba84ae64bf9d8d3d 100644 (file)
@@ -1,4 +1,4 @@
-
+
 
  
   SET CONSTRAINTS
@@ -8,7 +8,7 @@
 
  
   SET CONSTRAINTS
-  set constraint checking modes for the current transaction
+  set constraint check timing for the current transaction
  
 
  
@@ -46,7 +46,8 @@ SET CONSTRAINTS { ALL | name [, ...
 
   
    SET CONSTRAINTS with a list of constraint names changes
-   the mode of just those constraints (which must all be deferrable).  The
+   the mode of just those constraints (which must all be deferrable).  Each
+   constraint name can be schema-qualified.  The
    current schema search path is used to find the first matching name if
    no schema name is specified.  SET CONSTRAINTS ALL
    changes the mode of all deferrable constraints.
@@ -66,13 +67,14 @@ SET CONSTRAINTS { ALL | name [, ...
   
 
   
-   Currently, only UNIQUE, PRIMARY KEY, and
-   REFERENCES (foreign key) constraints are affected by this
-   setting.  NOT NULL and CHECK constraints are
+   Currently, only UNIQUE, PRIMARY KEY,
+   REFERENCES (foreign key), and EXCLUDE
+   constraints are affected by this setting.
+   NOT NULL and CHECK constraints are
    always checked immediately when a row is inserted or modified
    (not at the end of the statement).
-   Uniqueness constraints that have not been declared DEFERRABLE
-   are also checked immediately.
+   Uniqueness and exclusion constraints that have not been declared
+   DEFERRABLE are also checked immediately.
   
 
   
@@ -85,6 +87,16 @@ SET CONSTRAINTS { ALL | name [, ...
  
   Notes
 
+  
+   Because PostgreSQL does not require constraint
+   names to be unique within a schema (but only per-table), it is possible
+   that there is more than one match for a specified constraint name.
+   In this case SET CONSTRAINTS will act on all matches.
+   For a non-schema-qualified name, once a match or matches have been found in
+   some schema in the search path, schemas appearing later in the path are not
+   searched.
+  
+
   
    This command only alters the behavior of constraints within the
    current transaction. Thus, if you execute this command outside of a
@@ -100,8 +112,11 @@ SET CONSTRAINTS { ALL | name [, ...
   
    This command complies with the behavior defined in the SQL
    standard, except for the limitation that, in
-   PostgreSQL, it only applies to
-   foreign-key and uniqueness constraints.
+   PostgreSQL, it does not apply to
+   NOT NULL and CHECK constraints.
+   Also, PostgreSQL checks non-deferrable
+   uniqueness constraints immediately, not at end of statement as the
+   standard would suggest.