数据仓库服务 GAUSSDB(DWS)-范围分区表添加新分区报错upper boundary of adding partition MUST overtop last existing partition:问题现象

时间:2024-11-02 18:44:30

问题现象

创建范围分区表后增加新的分区,使用ALTER TABLE ADD PARTITION语句报错upper boundary of adding partition MUST overtop last existing partition。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
——创建范围分区表studentinfo
CREATE TABLE studentinfo (stuno smallint, sname varchar(20), score varchar(20), examate timestamp)
PARTITION BY RANGE (examate) (
   PARTITION p1 VALUES LESS THAN ('2022-10-10 00:00:00+08'),
   PARTITION p2 VALUES LESS THAN ('2022-10-11 00:00:00+08'),
   PARTITION p3 VALUES LESS THAN ('2022-10-12 00:00:00+08'),
   PARTITION p4 VALUES LESS THAN (maxvalue)
);
——添加边界值为2022-10-9 00:00:00+08的分区p0
ALTER TABLE studentinfo ADD PARTITION p0 values less than ('2022-10-9 00:00:00+08');
ERROR:  the boundary of partition "p0" is less than previous partition's boundary
——添加边界值为2022-10-13 00:00:00+08的分区p5
ALTER TABLE studentinfo ADD PARTITION p5 values less than ('2022-10-13 00:00:00+08');
ERROR:  the boundary of partition "p5" is equal to previous partition's boundary
support.huaweicloud.com/trouble-dws/dws_09_0127.html