postgresql 分表

create table test_part
(
    id   int,
    name varchar,
    age  numeric
) partition by range (age);
create table test_part_yong partition of test_part for values from (MINVALUE ) to (25);
create table test_part_medium partition of test_part for values from (25) to (75);
create table test_part_old partition of test_part for values from (75) to (maxvalue );

配合触发器功能可以自动创建分表

posted @ 2022-09-26 09:54  那时一个人  阅读(97)  评论(0)    收藏  举报