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

postgres: Support creating partitioned tables

Open gitmalong opened this issue 2 years ago • 4 comments

Hi!

The TableCreateStatement does not support creating partitioned tables.

  1. Create partitioned table statement
CREATE TABLE measurement (
    city_id         int not null,
    logdate         date not null,
) PARTITION BY RANGE (logdate);
  1. Create partition statement
CREATE TABLE measurement_y2006m02 PARTITION OF measurement
    FOR VALUES FROM ('2006-02-01') TO ('2006-03-01');

Reasoning:

  • I see this feature request plus #1922 as the necessary features to make SeaORM + Postgres work well with huge amounts of data.

Sponsored some beer (:

Thanks

gitmalong avatar Nov 07 '23 15:11 gitmalong

Thank you for the sponsorship. I am not sure where there is an issue for PARTITION BY RANGE on sea-query. I'll assess the difficult / effort needed.

tyt2y3 avatar Dec 01 '23 14:12 tyt2y3

Hi. You're welcome. I created a corresponding issue: https://github.com/SeaQL/sea-query/issues/722

gitmalong avatar Dec 01 '23 14:12 gitmalong

I'm also interested in this. What are the blockers? And what would creating partitions with SeaORM in the meantime look like (I guess using .extra)?

delbonis avatar Apr 10 '24 17:04 delbonis