Adding a Default Partition in Greenplum

You can add a default partition to an existing partition design using the ALTER TABLE command.

ALTER TABLE sales ADD DEFAULT PARTITION other;

If your partition design is multi-leveled, then each level in the hierarchy needs a default partition. For example:

ALTER TABLE sales ALTER PARTITION FOR (RANK(1)) ADD DEFAULT PARTITION other;
ALTER TABLE sales ALTER PARTITION FOR (RANK(2)) ADD DEFAULT PARTITION other;
ALTER TABLE sales ALTER PARTITION FOR (RANK(3)) ADD DEFAULT PARTITION other;

Partition designs that do not have a default partition will reject incoming rows that do not match to an existing partition’s CHECK constraint. If a partitioned table has a default partition, incoming data that does not match to an existing partition is instead inserted into the default partition.
Comments