From 83df16f1fa5ccce72534ddad51fd0109da1e49e2 Mon Sep 17 00:00:00 2001 From: Alexander Korotkov Date: Tue, 19 May 2026 13:39:53 +0300 Subject: [PATCH] Clarify SPLIT PARTITION bound requirements in docs The documentation said that the bounds of new partitions should not overlap and that their combined bounds should equal the bounds of the split partition. That is misleading when a new DEFAULT partition is specified, because the explicit partitions may cover only part of the split partition while the DEFAULT partition covers the rest. Clarify that new non-DEFAULT partition bounds must not overlap with other new or existing partitions and must be contained within the bounds of the split partition. Also state that the combined bounds must exactly match the split partition only when no new DEFAULT partition is specified. While here, improve nearby wording about hash-partitioned target tables and splitting a DEFAULT partition with the same partition name. Author: Chao Li Reviewed-by: Alexander Korotkov Discussion: https://postgr.es/m/C18878AB-DEB2-4A61-9995-A035DD644B81@gmail.com --- doc/src/sgml/ref/alter_table.sgml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index 1f9a456fd33..dec34337d1a 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -1293,7 +1293,7 @@ WITH ( MODULUS numeric_literal, REM This form splits a single partition of the target table into new - partitions. Hash-partitioned target table is not supported. + partitions. Hash-partitioned target tables are not supported. Only a simple, non-partitioned partition can be split. If the split partition is the DEFAULT partition, one of the new partitions must be DEFAULT. @@ -1303,18 +1303,23 @@ WITH ( MODULUS numeric_literal, REM - The bounds of new partitions should not overlap with those of new or - existing partitions (except partition_name). - The combined bounds of new partitions + The bounds of new non-DEFAULT partitions must not + overlap with those of new or existing partitions, except + partition_name, and must be + contained within the bounds of the split partition + partition_name. + If no new DEFAULT partition is specified, the + combined bounds of the new partitions + partition_name1, partition_name2[, ...] - should be equal to the bounds of the split partition + must exactly match the bounds of the split partition partition_name. One of the new partitions can have the same name as the split partition - partition_name - (this is suitable in case of splitting the DEFAULT - partition: after the split, the DEFAULT partition - remains with the same name, but its partition bound changes). + partition_name. + This is useful when splitting the DEFAULT partition, + so that after the split, the DEFAULT partition + keeps the same name but its partition bound changes.