Verify your knowledge
- Is it possible to perform declarative partitioning in PostgreSQL?
Yes, starting from PostgreSQL 10, it is possible to use declarative partitioning.
See the Exploring declarative partitioning section for more details.
- If we have a table such as:
CREATE TABLE mytable ( pk serial NOT NULL, create_date date not null default now()::date, primary key (pk) )
- Is it possible to partition that table for range? Yes, it is possible by writing something like the following:
CREATE TABLE mytable ( pk serial NOT NULL, create_date date not null default now()::date, primary key (pk,creat_edate) )PARTITION BY RANGE (create_date); CREATE TABLE forumdb=> CREATE TABLE part_tags_date_01 PARTITION OF part_tags FOR VALUES FROM (‘2023-01-01’) TO (‘2023-06-31’); forumdb=> CREATE TABLE part_tags_date_01 PARTITION OF part_tags FOR VALUES FROM (‘2023...