比如说我想把每个月1号的数据分到同一个区,2号的数据分到同一个区,以此类推,能实现吗?
你就建两个table表,一个存每月1号的数据,另一个存每月2号的数据
根本不用分区,只要查询的时候能根据日期判断是1还是2就好了
create table parent__table(
id bigserial primary key ,
name varchar(32),
time timestamp(3) not null);
建立子表,继承主表
create table parent_table_2018_05(
check (time>=date '2018-05-01' and time<date '2018-06-01'))
inherits(parent_table);