1
0
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:
Alvaro Herrera
2012-01-16 19:19:42 -03:00
parent 1b9f774090
commit 3b11247aad
3 changed files with 37 additions and 10 deletions

View File

@ -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.