From 19f0a7ec08bf6a95dd3af6742f7be7bf000acde1 Mon Sep 17 00:00:00 2001 From: "David G. Johnston" Date: Wed, 7 Jan 2026 14:53:50 -0700 Subject: [PATCH 2/2] doc Clarify ALTER TABLE edits --- doc/src/sgml/ref/alter_table.sgml | 144 +++++++++++++----------------- 1 file changed, 62 insertions(+), 82 deletions(-) diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index b1190fae968..75a26087eb6 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -173,7 +173,7 @@ WITH ( MODULUS numeric_literal, REM When applied to a partitioned table, the column is added to the - partitioned table definition and is implicitly present in all + partitioned table definition and is implicitly added to all partitions. Specifying ONLY is not allowed, and this command cannot be used on individual partitions. @@ -232,9 +232,9 @@ WITH ( MODULUS numeric_literal, REM When applied to a partitioned table, the data type change is applied - to the partitioned table definition and affects all partitions. - Specifying ONLY is not allowed, and this command - cannot be used on individual partitions. + to the partitioned table definition and is implicitly applied to all + partitions. Specifying ONLY is not allowed, + and this command cannot be used on individual partitions. @@ -251,10 +251,9 @@ WITH ( MODULUS numeric_literal, REM When applied to a partitioned table, the default value is propagated - to all existing partitions unless ONLY is specified. - New partitions created afterwards inherit the default from the - partitioned table, but individual partitions may define a different - default. + to all partitions unless ONLY is specified. + Newly created partitions inherit the default from the partitioned table + unless they define a different default. @@ -289,8 +288,7 @@ WITH ( MODULUS numeric_literal, REM children can disallow nulls even if the parent allows them, but not the other way around. It is also possible to apply SET NOT NULL or DROP NOT NULL to - ONLY the parent table, which does not affect the - children. + ONLY the parent table. @@ -313,10 +311,9 @@ WITH ( MODULUS numeric_literal, REM When applied to a partitioned table, the generation expression is - propagated to all existing partitions unless ONLY - is specified. New partitions created afterwards inherit the - expression from the partitioned table, while individual partitions - may define a different expression. + propagated to all partitions unless ONLY + is specified. Newly created partitions inherit the expression from the + partitioned table unless they define a different expression. @@ -368,7 +365,7 @@ WITH ( MODULUS numeric_literal, REM When applied to a partitioned table, the identity property is defined - on the partitioned table definition and applies to all partitions. + on the partitioned table and is applied to all partitions. Specifying ONLY is not allowed, and these forms cannot be used on individual partitions. @@ -388,7 +385,7 @@ WITH ( MODULUS numeric_literal, REM When applied to a partitioned table, these forms alter the sequence associated with the identity column on the partitioned table - definition and affect all partitions. Specifying ONLY + and all individual partitions. Specifying ONLY is not allowed, and these forms cannot be used on individual partitions. @@ -456,11 +453,10 @@ WITH ( MODULUS numeric_literal, REM SHARE UPDATE EXCLUSIVE lock. - For partitioned tables, these forms can be applied independently to - the partitioned table and to individual partitions. Changes made to - the partitioned table do not propagate to existing partitions, and - partitions created afterwards do not inherit the setting. - Specifying ONLY is allowed but has no effect. + For partitioned tables, these forms must be applied separately to + the partitioned table and/or to individual partitions. + Newly created partitions do not inherit their attribute options from the + partitioned table. @@ -499,9 +495,8 @@ WITH ( MODULUS numeric_literal, REM When applied to a partitioned table, the storage setting is propagated to all existing partitions unless ONLY is specified. - New partitions created afterwards inherit the setting from the - partitioned table, while individual partitions may use a different - storage setting. + Newly created partitions inherit the setting from the partitioned table + unless they define a different storage setting. @@ -534,12 +529,11 @@ WITH ( MODULUS numeric_literal, REM at the time of data insertion to determine the method to use. - When applied to a partitioned table, the compression setting is applied - to the partitioned table definition and does not propagate to existing - partitions. New partitions created afterwards inherit the setting from - the partitioned table, while individual partitions may use a different - compression method. Specifying ONLY is allowed but has - no effect. + When applied to a partitioned table, the compression method must be + applied separately to the partitioned table and/or to individual partitions. + Specifying ONLY is allowed but has no effect. + However, newly created partitions inherit the compression method from the + partitioned table unless they define a different compression method. @@ -584,9 +578,9 @@ WITH ( MODULUS numeric_literal, REM When applied to a partitioned table, the constraint is added to the - partitioned table and is automatically applied to all partitions. - Specifying ONLY is not allowed. New partitions - created afterwards inherit the constraint from the partitioned table. + partitioned table and is implicitly added to all partitions. + Specifying ONLY is not allowed. + Newly created partitions inherit constraints from the partitioned table. @@ -627,7 +621,7 @@ WITH ( MODULUS numeric_literal, REM This form is not supported on partitioned tables, but can be used on - individual (leaf) partitions. + individual partitions. @@ -651,7 +645,7 @@ WITH ( MODULUS numeric_literal, REM When applied to a partitioned table, the constraint is altered on the - partitioned table definition and the change applies to all partitions. + partitioned table definition is implicitly applied to all partitions. Specifying ONLY is not allowed, and this command cannot be used on individual partitions. @@ -676,7 +670,7 @@ WITH ( MODULUS numeric_literal, REM These forms are not supported on partitioned tables, but can be used - on individual (leaf) partitions. + on individual partitions. @@ -717,9 +711,8 @@ WITH ( MODULUS numeric_literal, REM When applied to a partitioned table, the constraint is dropped from all existing partitions unless ONLY is specified. - New partitions created afterwards do not include the dropped - constraint, while individual partitions may drop the constraint - independently of the partitioned table. + Individual partitions may drop constraints independently of the + partitioned table. @@ -793,11 +786,10 @@ WITH ( MODULUS numeric_literal, REM described above. - For partitioned tables, these forms can be applied independently to - the partitioned table and to individual partitions. Changes made to - the partitioned table do not propagate to existing partitions, and - partitions created afterwards do not inherit the setting. - Specifying ONLY is allowed but has no effect. + For partitioned tables, these forms must be applied separately to + the partitioned table and/or to individual partitions. + Newly created partitions do not inherit the setting from the + partitioned table. @@ -815,11 +807,10 @@ WITH ( MODULUS numeric_literal, REM CREATE POLICY. - For partitioned tables, these forms can be applied independently to - the partitioned table and to individual partitions. Changes made to - the partitioned table do not propagate to existing partitions, and - partitions created afterwards do not inherit the setting. - Specifying ONLY is allowed but has no effect. + For partitioned tables, these forms must be applied separately to + the partitioned table and/or to individual partitions. + Newly created partitions do not inherit the setting from the + partitioned table. @@ -837,11 +828,10 @@ WITH ( MODULUS numeric_literal, REM CREATE POLICY. - For partitioned tables, these forms can be applied independently to - the partitioned table and to individual partitions. Changes made to - the partitioned table do not propagate to existing partitions, and - partitions created afterwards do not inherit the setting. - Specifying ONLY is allowed but has no effect. + For partitioned tables, these forms must be applied separately to + the partitioned table and/or to individual partitions. + Newly created partitions do not inherit the setting from the + partitioned table. @@ -859,7 +849,7 @@ WITH ( MODULUS numeric_literal, REM This form is not supported on partitioned tables, but can be used on - individual (leaf) partitions. + individual partitions. @@ -878,7 +868,7 @@ WITH ( MODULUS numeric_literal, REM This form is not supported on partitioned tables, but can be used on - individual (leaf) partitions. + individual partitions. @@ -891,12 +881,6 @@ WITH ( MODULUS numeric_literal, REM system column. As oid system columns cannot be added anymore, this never has an effect. - - For partitioned tables, this form behaves the same as for regular - tables; it has no effect on either the partitioned table or its - partitions. Specifying ONLY is allowed but has no - effect. - @@ -972,7 +956,7 @@ WITH ( MODULUS numeric_literal, REM This form is not supported on partitioned tables, but can be used on - individual (leaf) partitions. + individual partitions. @@ -1001,7 +985,7 @@ WITH ( MODULUS numeric_literal, REM This form is not supported on partitioned tables, but can be used on - individual (leaf) partitions. + individual partitions. @@ -1016,7 +1000,7 @@ WITH ( MODULUS numeric_literal, REM When applied to a partitioned table, this form is accepted but has no - effect. It can be used on individual (leaf) partitions, where it + effect. It can be used on individual partitions, where it behaves as for a regular table. @@ -1109,11 +1093,10 @@ WITH ( MODULUS numeric_literal, REM or foreign table to the specified user. - For partitioned tables, this form can be applied independently to the - partitioned table and to individual partitions. Changing the owner of - the partitioned table does not affect existing partitions, and - partitions created afterwards do not inherit the new owner. - Specifying ONLY is allowed but has no effect. + For partitioned tables, this form must be applied separately to + the partitioned table and/or to individual partitions. + Newly created partitions do not inherit their owner from the + partitioned table. @@ -1173,11 +1156,10 @@ WITH ( MODULUS numeric_literal, REM - For partitioned tables, this form can be applied independently to the - partitioned table and to individual partitions. Changing the replica - identity of the partitioned table does not affect existing partitions, - and partitions created afterwards do not inherit the setting. - Specifying ONLY is allowed but has no effect. + For partitioned tables, this form must be applied independently to the + partitioned table and/or to individual partitions. + Newly created partitions do not inherit the setting from the + partitioned table. @@ -1196,8 +1178,7 @@ WITH ( MODULUS numeric_literal, REM For partitioned tables, this form behaves the same as for regular tables. Renaming a partitioned table, column, or constraint does not - propagate to partitions, and ONLY can be specified - but has no effect. + propagate to partitions. @@ -1210,11 +1191,10 @@ WITH ( MODULUS numeric_literal, REM constraints, and sequences owned by table columns are moved as well. - For partitioned tables, this form can be applied independently to the - partitioned table and to individual partitions. Moving the partitioned - table to another schema does not affect existing partitions, and - partitions created afterwards do not inherit the new schema. - Specifying ONLY is allowed but has no effect. + For partitioned tables, this form must be applied independently to the + partitioned table and/or to individual partitions. + Newly created partitions do not inherit their schema from the + partitioned table. -- 2.34.1