PostgreSQL12.5中分區表的一些操作實例
時間:2024-02-24 17:17作者:下載吧人氣:23
1、創建一個有DEFAULT的分區表
1、先創建主表
create table tbl_log
(
id serial,
create_time timestamp(0) without time zone,
remark char(1)
) PARTITION BY RANGE (create_time);
#因為是serial類型,自增的所以會自動創建一個序列
postgres=# d
List of relations
Schema | Name | Type | Owner
——–+—————-+——————-+———-
public | tbl_log | partitioned table | postgres
public | tbl_log_id_seq | sequence | postgres
(7 rows)
網友評論