You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATETABLEfoo (..) PARTITION BY RANGE (x, y);
CREATETABLEfoo (..) PARTITION BY LIST (x, y);
CREATETABLEfoo (..) PARTITION BY HASH (x, y); -- Postgres 11 only
Create a partition:
CREATETABLEfoo_part PARTITION OF foo FOR VALUESFROM (1) TO (100); -- rangeCREATETABLEfoo_part PARTITION OF foo FOR VALUESIN (1, 2, 3); -- listCREATETABLEfoo_part PARTITION OF foo FOR VALUES WITH (MODULUS 4, REMAINDER 0); -- hash, PG11 onlyCREATETABLEfoo_part PARTITION OF foo DEFAULT; -- list or range, PG11 only
ALTERTABLE foo ATTACH PARTITION foo_part FOR VALUESFROM (1) TO (100); -- rangeALTERTABLE foo ATTACH PARTITION foo_part FOR VALUESIN (1, 2, 3); -- rangeALTERTABLE foo ATTACH PARTITION foo_part FOR VALUES WITH (MODULUS 4, REMAINDER 0); -- hash, PG11 onlyALTERTABLE foo ATTACH PARTITION foo_part DEFAULT; -- list or range, PG11 only
Detach partition:
ALTERTABLE foo DETACH PARTITION foo_part;
For our purposes CREATE TABLE .. PARTITION OF .., ALTER TABLE .. ATTACH PARTITION .. and ALTER TABLE .. DETACH PARTITION .. would be enough as we're unlikely to do the creation of the partitioned table in the app at runtime, but maybe others would find it useful.
Versions:
Database: PostgreSQL 10 / 11, all vendors
PostgreSQL 10 added support for range and list partitioning
PostgreSQL 11 (when released) adds support for hash partitioning and default partitions.
The text was updated successfully, but these errors were encountered:
Thank you very much for your report. Indeed, supporting table partitions has been on the roadmap for a while, for Oracle. See e.g. #2774, #2775. An implementation in jOOQ would need to cover both databases' feature sets and also extend to DML usage of partitioned tables, and the code generator, of course.
Hi there, please, is there any suggested workaround to programatically create partition to execute "CREATE TABLE table_part1 PARTITION OF table FOR VALUES IN(1,2,3,...)". I am newbee in jOOQ and I am leaning toward using DSL.execute("CREATE TABLE ...") which works but checking if there is more type safe way of workaround. Thank you.
This is mentioned briefly in #7518, but worth fleshing out what useful support would look like.
This would be support for the various statements described here.
Create a partitioned table:
Create a partition:
Attach partition:
Detach partition:
For our purposes
CREATE TABLE .. PARTITION OF ..
,ALTER TABLE .. ATTACH PARTITION ..
andALTER TABLE .. DETACH PARTITION ..
would be enough as we're unlikely to do the creation of the partitioned table in the app at runtime, but maybe others would find it useful.Versions:
The text was updated successfully, but these errors were encountered: