From c2347fe5fa10c3d413a00847e81b557d96d3d16a Mon Sep 17 00:00:00 2001
From: "Chao Li (Evan)" <lic@highgo.com>
Date: Fri, 29 May 2026 06:47:07 +0800
Subject: [PATCH v6 2/3] doc: Clarify inherited constraint behavior

Update the table inheritance documentation to mention not-null constraints
alongside check constraints where inherited constraints are discussed.

Also clarify that some properties of inherited constraints can now be altered
directly on child tables, while the resulting constraint must remain compatible
with its inherited parent constraints.  For multiple inheritance, say explicitly
that when a column or constraint is inherited from more than one parent, the
stricter definition applies.

Author: Chao Li <lic@highgo.com>
---
 doc/src/sgml/ddl.sgml | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index 747f929aee3..afcc642bcb7 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -4104,8 +4104,9 @@ VALUES ('Albany', NULL, NULL, 'NY');
    To do this the new child table must already include columns with
    the same names and types as the columns of the parent. It must also include
    check constraints with the same names and check expressions as those of the
-   parent. Similarly an inheritance link can be removed from a child using the
-   <literal>NO INHERIT</literal> variant of <command>ALTER TABLE</command>.
+   parent, as well as matching not-null constraints. Similarly an inheritance
+   link can be removed from a child using the <literal>NO INHERIT</literal>
+   variant of <command>ALTER TABLE</command>.
    Dynamically adding and removing inheritance links like this can be useful
    when the inheritance relationship is being used for table
    partitioning (see <xref linkend="ddl-partitioning"/>).
@@ -4124,21 +4125,25 @@ VALUES ('Albany', NULL, NULL, 'NY');
 
   <para>
    A parent table cannot be dropped while any of its children remain. Neither
-   can columns or check constraints of child tables be dropped or altered
-   if they are inherited
-   from any parent tables. If you wish to remove a table and all of its
-   descendants, one easy way is to drop the parent table with the
-   <literal>CASCADE</literal> option (see <xref linkend="ddl-depend"/>).
+   can inherited columns or inherited check and not-null constraints of child
+   tables be dropped directly.  Some properties of inherited constraints can
+   be altered, but each resulting constraint must remain compatible with all
+   parent constraints from which it is inherited.  If you wish to remove a
+   table and all of its descendants, one easy way is to drop the parent table
+   with the <literal>CASCADE</literal> option (see <xref linkend="ddl-depend"/>).
   </para>
 
   <para>
    <command>ALTER TABLE</command> will
-   propagate any changes in column data definitions and check
-   constraints down the inheritance hierarchy.  Again, dropping
+   propagate changes in column definitions and in inheritable constraints
+   (check and not-null constraints) down the inheritance hierarchy.  With
+   multiple inheritance, if a column or constraint is inherited from more
+   than one parent, the stricter definition applies.  Again, dropping
    columns that are depended on by other tables is only possible when using
    the <literal>CASCADE</literal> option. <command>ALTER
-   TABLE</command> follows the same rules for duplicate column merging
-   and rejection that apply during <command>CREATE TABLE</command>.
+   TABLE</command> follows the same rules for merging or rejecting duplicate
+   inherited column and constraint definitions that apply during
+   <command>CREATE TABLE</command>.
   </para>
 
   <para>
-- 
2.50.1 (Apple Git-155)

