mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Correct docs about partitions and EXCLUDE constraints.
In version 17 we added support for cross-partition EXCLUDE
constraints, as long as they included all partition key columns and
compared them with equality (see 8c852ba9a4). I updated the docs for
exclusion constraints, but I missed that the docs for CREATE TABLE
still said that they were not supported. This commit fixes that.
Author: Paul A. Jungwirth <pj@illuminatedcomputing.com>
Co-authored-by: Jeff Davis <pgsql@j-davis.com>
Discussion: https://postgr.es/m/c955d292-b92d-42d1-a2a0-1ec6715a2546@illuminatedcomputing.com
Backpatch-through: 17
			
			
This commit is contained in:
		@@ -442,11 +442,6 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
 | 
				
			|||||||
      the values in the new row, an error will be reported.
 | 
					      the values in the new row, an error will be reported.
 | 
				
			||||||
     </para>
 | 
					     </para>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     <para>
 | 
					 | 
				
			||||||
      Partitioned tables do not support <literal>EXCLUDE</literal> constraints;
 | 
					 | 
				
			||||||
      however, you can define these constraints on individual partitions.
 | 
					 | 
				
			||||||
     </para>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     <para>
 | 
					     <para>
 | 
				
			||||||
      See <xref linkend="ddl-partitioning"/> for more discussion on table
 | 
					      See <xref linkend="ddl-partitioning"/> for more discussion on table
 | 
				
			||||||
      partitioning.
 | 
					      partitioning.
 | 
				
			||||||
@@ -1125,6 +1120,18 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
 | 
				
			|||||||
      exclusion constraint on a subset of the table; internally this creates a
 | 
					      exclusion constraint on a subset of the table; internally this creates a
 | 
				
			||||||
      partial index. Note that parentheses are required around the predicate.
 | 
					      partial index. Note that parentheses are required around the predicate.
 | 
				
			||||||
     </para>
 | 
					     </para>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					     <para>
 | 
				
			||||||
 | 
					      When establishing an exclusion constraint for a multi-level partition
 | 
				
			||||||
 | 
					      hierarchy, all the columns in the partition key of the target
 | 
				
			||||||
 | 
					      partitioned table, as well as those of all its descendant partitioned
 | 
				
			||||||
 | 
					      tables, must be included in the constraint definition.  Additionally,
 | 
				
			||||||
 | 
					      those columns must be compared using the equality operator.  These
 | 
				
			||||||
 | 
					      restrictions ensure that potentially-conflicting rows will exist in the
 | 
				
			||||||
 | 
					      same partition.  The constraint may also refer to other columns which
 | 
				
			||||||
 | 
					      are not a part of any partition key, which can be compared using any
 | 
				
			||||||
 | 
					      appropriate operator.
 | 
				
			||||||
 | 
					     </para>
 | 
				
			||||||
    </listitem>
 | 
					    </listitem>
 | 
				
			||||||
   </varlistentry>
 | 
					   </varlistentry>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user