1、創(chuàng)建一個(gè)有DEFAULT的分區(qū)表
1、先創(chuàng)建主表
create table tbl_log
(
id serial,
create_time timestamp(0) without time zone,
remark char(1)
) PARTITION BY RANGE (create_time);
#因?yàn)槭莝erial類型,自增的所以會(huì)自動(dòng)創(chuàng)建一個(gè)序列
postgres=# d
List of relations
Schema | Name | Type | Owner
——–+—————-+——————-+———-
public | tbl_log | partitioned table | postgres
public | tbl_log_id_seq | sequence | postgres
(7 rows)
網(wǎng)友評(píng)論