数据仓库服务 GAUSSDB(DWS)-分区表插入数据报错:inserted partition key does not map to any table partition:问题现象

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

问题现象

给范围分区表插入数据报错:inserted partition key does not map to any table partition。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
CREATE TABLE startend_pt (c1 INT, c2 INT) 
DISTRIBUTE BY HASH (c1) 
PARTITION BY RANGE (c2) (
    PARTITION p1 START(1) END(1000) EVERY(200) ,
    PARTITION p2 END(2000),
    PARTITION p3 START(2000) END(2500) ,
    PARTITION p4 START(2500),
    PARTITION p5 START(3000) END(5000) EVERY(1000) 
);
SELECT partition_name,high_value FROM dba_tab_partitions WHERE table_name='startend_pt';
 partition_name | high_value
----------------+------------
 p1_0           | 1
 p1_1           | 201
 p1_2           | 401
 p1_3           | 601
 p1_4           | 801
 p1_5           | 1000
 p2             | 2000
 p3             | 2500
 p4             | 3000
 p5_1           | 4000
 p5_2           | 5000
(11 rows)

INSERT INTO startend_pt VALUES (1,5001);
ERROR:  dn_6003_6004: inserted partition key does not map to any table partition
support.huaweicloud.com/trouble-dws/dws_09_0119.html