逻辑分区表 本文为您介绍如何管理range分区表、list分区表和多级分区表。 range分区表 创建主分区 plaintext teledb create table tnativerange (f1 bigint,f2 timestamp default now(), f3 integer) partition by range ( f2 ) distribute by shard(f1); CREATE TABLE 建立两个子表 plaintext teledb create table tnativerange201709 partition of tnativerange (f1 ,f2 , f3 ) for values from ('20170901') to ('20171001'); CREATE TABLE teledb create table tnativerange201710 partition of tnativerange (f1 ,f2 , f3 ) for values from ('20171001') to ('20171101'); CREATE TABLE 查看表结构 plaintext teledb d+ tnativerange Table "public.tnativerange" Column Type Collation Nullable Default Storage Stats target Description +++++++ f1 bigint plain f2 timestamp without time zone now() plain f3 integer plain Partition key: RANGE (f2) Partitions: tnativerange201709 FOR VALUES FROM ('20170901 00:00:00') TO ('20171001 00:00:00'), tnativerange201710 FOR VALUES FROM ('20171001 00:00:00') TO ('20171101 00:00:00') Distribute By: SHARD(f1) Location Nodes: ALL DATANODES 创建default分区 不创建default 分区,插入范围越界出错。 plaintext teledb insert into tnativerange values(1,'20160901',1); ERROR: node:dn01, backendpid:39912, nodename:dn01,backendpid:39912,message:no partition of relation "tnativerange" found for row DETAIL: Partition key of the failing row contains (f2) (20160901 00:00:00). 创建default 分区后能正常插入数据。 plaintext teledb