逻辑分区表 CREATE TABLE tnativelistdefault PARTITION OF tnativelist DEFAULT; CREATE TABLE teledb insert into tnativelist values(1,'上海',1,currentdate); INSERT 0 1 多级分区表 创建主表 plaintext teledb create table tnativemullist(f1 bigserial not null,f2 integer,f3 text,f4 text, f5 date) partition by list ( f3 ) distribute by shard(f1); CREATE TABLE 创建二级表 plaintext teledb create table tnativemullistgd partition of tnativemullist for values in ('广东') partition by range(f5); CREATE TABLE teledb create table tnativemullistbj partition of tnativemullist for values in ('北京') partition by range(f5); CREATE TABLE teledb create table tnativemullistsh partition of tnativemullist for values in ('上海'); 创建三级表 plaintext teledb create table tnativemullistgd201701 partition of tnativemullistgd(f1,f2,f3,f4,f5) for values from ('20170101') to ('20170201'); CREATE TABLE teledb create table tnativemullistgd201702 partition of tnativemullistgd(f1,f2,f3,f4,f5) for values from ('20170201') to ('20170301'); CREATE TABLE teledb create table tnativemullistbj201701 partition of tnativemullistbj(f1,f2,f3,f4,f5) for values from ('20170101') to ('20170201'); CREATE TABLE teledb create table tnativemullistbj201702 partition of tnativemullistbj(f1,f2,f3,f4,f5) for values from ('20170201') to ('20170301'); CREATE TABLE 查看表结构 plaintext teledb d+ tnativemullist Table "public.tnativemullist" Column Type Collation Nullable Default Storage Stats target Description +++++++ f1 bigint not null nextval('tnativemullistf1seq'::regclass) plain f2 integer plain f3 text extended f4 text extended f5timestamp(0) without time zone plain Partition key: LIST (f3) Partitions: tnativemullistbj FOR VALUES IN ('北京'), PARTITIONED, tnativemullistgd FOR VALUES IN ('广东'), PARTITIONED, tnativemullistsh FOR VALUES IN ('上海') Distribute By: SHARD(f1) Location Nodes: ALL DATANODES teledb