diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c index 73dea0375be..7d3580cbc10 100644 --- a/src/backend/partitioning/partbounds.c +++ b/src/backend/partitioning/partbounds.c @@ -5405,7 +5405,7 @@ check_partition_bounds_for_split_range(Relation parent, errmsg("lower bound of partition \"%s\" is not equal to lower bound of split partition \"%s\"", relname, get_rel_name(splitPartOid)), - errhint("%s require combined bounds of new partitions must exactly match the bound of the split partition.", + errhint("%s requires the combined bounds of the new partitions to exactly match the bound of the split partition.", "ALTER TABLE ... SPLIT PARTITION"), parser_errposition(pstate, exprLocation((Node *) datum))); } @@ -5415,8 +5415,7 @@ check_partition_bounds_for_split_range(Relation parent, errmsg("lower bound of partition \"%s\" is less than lower bound of split partition \"%s\"", relname, get_rel_name(splitPartOid)), - errhint("%s require combined bounds of new partitions must exactly match the bound of the split partition.", - "ALTER TABLE ... SPLIT PARTITION"), + errhint("Explicit partition bounds must be contained within the bounds of the split partition when a DEFAULT partition is specified."), parser_errposition(pstate, exprLocation((Node *) datum))); } @@ -5448,7 +5447,7 @@ check_partition_bounds_for_split_range(Relation parent, errmsg("upper bound of partition \"%s\" is not equal to upper bound of split partition \"%s\"", relname, get_rel_name(splitPartOid)), - errhint("%s require combined bounds of new partitions must exactly match the bound of the split partition.", + errhint("%s requires the combined bounds of the new partitions to exactly match the bound of the split partition.", "ALTER TABLE ... SPLIT PARTITION"), parser_errposition(pstate, exprLocation((Node *) datum))); } @@ -5458,8 +5457,7 @@ check_partition_bounds_for_split_range(Relation parent, errmsg("upper bound of partition \"%s\" is greater than upper bound of split partition \"%s\"", relname, get_rel_name(splitPartOid)), - errhint("%s require combined bounds of new partitions must exactly match the bound of the split partition.", - "ALTER TABLE ... SPLIT PARTITION"), + errhint("Explicit partition bounds must be contained within the bounds of the split partition when a DEFAULT partition is specified."), parser_errposition(pstate, exprLocation((Node *) datum))); } } @@ -5654,7 +5652,7 @@ check_parent_values_in_new_partitions(Relation parent, errmsg("new partitions' combined partition bounds do not contain value (%s) but split partition \"%s\" does", "NULL", get_rel_name(partOid)), - errhint("%s require combined bounds of new partitions must exactly match the bound of the split partition.", + errhint("%s requires the combined bounds of the new partitions to exactly match the bound of the split partition.", "ALTER TABLE ... SPLIT PARTITION")); /* @@ -5697,7 +5695,7 @@ check_parent_values_in_new_partitions(Relation parent, errmsg("new partitions' combined partition bounds do not contain value (%s) but split partition \"%s\" does", deparse_expression((Node *) notFoundVal, NIL, false, false), get_rel_name(partOid)), - errhint("%s require combined bounds of new partitions must exactly match the bound of the split partition.", + errhint("%s requires the combined bounds of the new partitions to exactly match the bound of the split partition.", "ALTER TABLE ... SPLIT PARTITION")); } } diff --git a/src/test/regress/expected/partition_split.out b/src/test/regress/expected/partition_split.out index a2ccbe5138b..2b9a6aa50ed 100644 --- a/src/test/regress/expected/partition_split.out +++ b/src/test/regress/expected/partition_split.out @@ -56,7 +56,7 @@ ALTER TABLE sales_range SPLIT PARTITION sales_feb_mar_apr2022 INTO ERROR: lower bound of partition "sales_feb2022" is not equal to lower bound of split partition "sales_feb_mar_apr2022" LINE 2: (PARTITION sales_feb2022 FOR VALUES FROM ('2022-01-01') TO... ^ -HINT: ALTER TABLE ... SPLIT PARTITION require combined bounds of new partitions must exactly match the bound of the split partition. +HINT: ALTER TABLE ... SPLIT PARTITION requires the combined bounds of the new partitions to exactly match the bound of the split partition. -- ERROR -- (We can create partition with the same name as split partition, but can't create two partitions with the same name) ALTER TABLE sales_range SPLIT PARTITION sales_feb_mar_apr2022 INTO @@ -97,7 +97,7 @@ ALTER TABLE sales_range SPLIT PARTITION sales_feb_mar_apr2022 INTO ERROR: upper bound of partition "sales_apr2022" is not equal to upper bound of split partition "sales_feb_mar_apr2022" LINE 4: ... sales_apr2022 FOR VALUES FROM ('2022-04-01') TO ('2022-06-0... ^ -HINT: ALTER TABLE ... SPLIT PARTITION require combined bounds of new partitions must exactly match the bound of the split partition. +HINT: ALTER TABLE ... SPLIT PARTITION requires the combined bounds of the new partitions to exactly match the bound of the split partition. -- ERROR ALTER TABLE sales_range SPLIT PARTITION sales_feb_mar_apr2022 INTO (PARTITION sales_feb2022 FOR VALUES FROM ('2022-02-01') TO ('2022-03-01'), @@ -118,7 +118,7 @@ ALTER TABLE sales_range SPLIT PARTITION sales_feb_mar_apr2022 INTO ERROR: lower bound of partition "sales_feb2022" is not equal to lower bound of split partition "sales_feb_mar_apr2022" LINE 2: (PARTITION sales_feb2022 FOR VALUES FROM ('2022-02-02') TO... ^ -HINT: ALTER TABLE ... SPLIT PARTITION require combined bounds of new partitions must exactly match the bound of the split partition. +HINT: ALTER TABLE ... SPLIT PARTITION requires the combined bounds of the new partitions to exactly match the bound of the split partition. -- Check the source partition not in the search path SET search_path = partition_split_schema2, public; ALTER TABLE partition_split_schema.sales_range @@ -154,7 +154,7 @@ ALTER TABLE sales_range SPLIT PARTITION sales_feb_mar_apr2022 INTO ERROR: upper bound of partition "sales_apr2022" is not equal to upper bound of split partition "sales_feb_mar_apr2022" LINE 4: ... sales_apr2022 FOR VALUES FROM ('2022-04-01') TO ('2022-06-0... ^ -HINT: ALTER TABLE ... SPLIT PARTITION require combined bounds of new partitions must exactly match the bound of the split partition. +HINT: ALTER TABLE ... SPLIT PARTITION requires the combined bounds of the new partitions to exactly match the bound of the split partition. DROP TABLE sales_range; -- -- Add rows into partitioned table then split partition @@ -917,14 +917,14 @@ ALTER TABLE sales_list SPLIT PARTITION sales_all INTO PARTITION sales_east FOR VALUES IN ('Beijing', 'Delhi', 'Vladivostok'), PARTITION sales_central FOR VALUES IN ('Warsaw', 'Berlin', 'Kyiv')); ERROR: new partitions' combined partition bounds do not contain value (NULL) but split partition "sales_all" does -HINT: ALTER TABLE ... SPLIT PARTITION require combined bounds of new partitions must exactly match the bound of the split partition. +HINT: ALTER TABLE ... SPLIT PARTITION requires the combined bounds of the new partitions to exactly match the bound of the split partition. -- ERROR ALTER TABLE sales_list SPLIT PARTITION sales_all INTO (PARTITION sales_west FOR VALUES IN ('Lisbon', 'New York', 'Madrid'), PARTITION sales_east FOR VALUES IN ('Beijing', 'Delhi', 'Vladivostok'), PARTITION sales_central FOR VALUES IN ('Warsaw', 'Berlin', NULL)); ERROR: new partitions' combined partition bounds do not contain value ('Kyiv'::character varying(20)) but split partition "sales_all" does -HINT: ALTER TABLE ... SPLIT PARTITION require combined bounds of new partitions must exactly match the bound of the split partition. +HINT: ALTER TABLE ... SPLIT PARTITION requires the combined bounds of the new partitions to exactly match the bound of the split partition. -- ERROR ALTER TABLE sales_list SPLIT PARTITION sales_all INTO (PARTITION sales_west FOR VALUES IN ('Lisbon', 'New York', 'Madrid'), @@ -1201,7 +1201,7 @@ ALTER TABLE t SPLIT PARTITION tp_0_51 INTO ERROR: upper bound of partition "tp_0_51" is greater than upper bound of split partition "tp_0_51" LINE 2: (PARTITION tp_0_51 FOR VALUES FROM (0) TO (53), ^ -HINT: ALTER TABLE ... SPLIT PARTITION require combined bounds of new partitions must exactly match the bound of the split partition. +HINT: Explicit partition bounds must be contained within the bounds of the split partition when a DEFAULT partition is specified. DROP TABLE t; -- -- Try to SPLIT partition of another table.