mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Disallow merging ONLY constraints in children tables
When creating a child table, or when attaching an existing table as child of another, we must not allow inheritable constraints to be merged with non-inheritable ones, because then grandchildren would not properly get the constraint. This would violate the grandparent's expectations. Bugs noted by Robert Haas. Author: Nikhil Sontakke
This commit is contained in:
@ -482,7 +482,11 @@ ALTER TABLE <replaceable class="PARAMETER">name</replaceable>
|
||||
|
||||
<para>
|
||||
There must also be matching child-table constraints for all
|
||||
<literal>CHECK</literal> constraints of the parent. Currently
|
||||
<literal>CHECK</literal> constraints of the parent, except those
|
||||
marked non-inheritable (that is, created with <literal>ALTER TABLE ONLY</literal>)
|
||||
in the parent, which are ignored; all child-table constraints matched
|
||||
must not be marked non-inheritable.
|
||||
Currently
|
||||
<literal>UNIQUE</literal>, <literal>PRIMARY KEY</literal>, and
|
||||
<literal>FOREIGN KEY</literal> constraints are not considered, but
|
||||
this might change in the future.
|
||||
|
Reference in New Issue
Block a user