1、創(chuàng)建一個有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);
#因為是serial類型,自增的所以會自動創(chuàng)建一個序列
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)友評論