1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Clarify policy on marking inherited constraints as valid.

Amit Langote and Robert Haas
This commit is contained in:
Robert Haas
2016-09-15 17:24:54 -04:00
parent 5c6df67e0c
commit 5225c66336
2 changed files with 11 additions and 6 deletions

View File

@ -1028,11 +1028,15 @@ ALTER TABLE ALL IN TABLESPACE <replaceable class="PARAMETER">name</replaceable>
<para>
If a table has any descendant tables, it is not permitted to add,
rename, or change the type of a column, or rename an inherited constraint
in the parent table without doing
the same to the descendants. That is, <command>ALTER TABLE ONLY</command>
will be rejected. This ensures that the descendants always have
columns matching the parent.
rename, or change the type of a column in the parent table without doing
same to the descendants. This ensures that the descendants always have
columns matching the parent. Similarly, a constraint cannot be renamed
in the parent without also renaming it in all descendents, so that
constraints also match between the parent and its descendents.
Also, because selecting from the parent also selects from its descendents,
a constraint on the parent cannot be marked valid unless it is also marked
valid for those descendents. In all of these cases, <command>ALTER TABLE
ONLY</command> will be rejected.
</para>
<para>