Creating Partition from GUI
To add a partition to a partitioned PostgreSQL table, open that table, switch to the Partitions page of the Table window, and click Add button.
Creating Partition Options
Partition name | Specify a name for the partition. In PostgreSQL, a partition is a separate table, so name the partition according to the table naming rules. |
Partition expression | Specify the partition expression. |
Partition by | If the new table must be partitioned (i.e. have sub-partitions), specify the PARTITION BY clause, for example, RANGE (<expression>). |
Description | Specify the table description (optional). |
Additional commands | Specify additional SQL commands to be executed, for example, adding table constraints and/or indexes. |
Action | Specify either to add the partition and apply additional commands immediately or generate SQL code instead. In latter case, you are able to modify the generated SQL code before applying the commands. |
Creating Partition by SQL
Advanced users can also create a table partition by executing SQL query like this (read your database documentation for details):
CREATE TABLE <table_name> PARTITION OF <parent_table_name> FOR VALUES <expression>
See also