sea-query icon indicating copy to clipboard operation
sea-query copied to clipboard

postgres: Support creating partitioned tables

Open gitmalong opened this issue 2 years ago • 1 comments

I'd love to see SeaQuery support creating partitioned Postgres tables.

Motivation

Partitioned Postgres tables help to scale Postgres / can drastically improve performance on large data sets.

Proposed Solutions

For a full blown partition support there are some more expressions that need to be supported but I think the support for creating tables with PARTITION BY RANGE is already a good starting point. Hence this issue is just about that.

CREATE TABLE measurement (
    city_id         int not null,
    logdate         date not null,
) PARTITION BY RANGE (logdate);

Additional Information

This issue blocks https://github.com/SeaQL/sea-orm/issues/1962

gitmalong avatar Dec 01 '23 14:12 gitmalong

FYI: if you have a regular web app and you statically know the schema that you want, you can always just write migrations in raw SQL.

This feature is only a blocker if you dynamically generate migration statements based on some conditions. It would still be nice to support this use case, of course.

Expurple avatar Jun 02 '25 13:06 Expurple