On 2016/07/25 17:18, Amit Langote wrote:
> The comment seems to have been copied from ATExecAddColumn, which says:
> 
>  /*
>   * If we are told not to recurse, there had better not be any
> - * child tables; else the addition would put them out of step.
> 
> For ATExecValidateConstraint, it should say something like:
> 
> + * child tables; else validating the constraint would put them
> + * out of step.
> 
> Attached patch fixes it.

I noticed that the ALTER TABLE documentation doesn't mention that VALIDATE
CONSTRAINT will fail if ONLY is specified and there are descendant tables.
 It only mentions that a constraint cannot be renamed unless also renamed
in the descendant tables.

Attached patch fixes that.

Thanks,
Amit
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index 6f51cbc..975b395 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -1028,11 +1028,11 @@ 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
+    rename, or change the type of a column, rename or validate 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.
+    columns and constraints matching the parent.
    </para>
 
    <para>
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to