ALTER TABLE...DROP PARTITION v16

Use the ALTER TABLE… DROP PARTITION command to delete a partition definition and the data stored in that partition. The syntax is:

ALTER TABLE <table_name> DROP PARTITION <partition_name>;

Parameters

table_name

The name (optionally schema-qualified) of the partitioned table.

partition_name

The name of the partition to delete.

Description

The ALTER TABLE… DROP PARTITION command deletes a partition and any data stored on that partition. The ALTER TABLE… DROP PARTITION command can drop partitions of a LIST or RANGE partitioned table. This command doesn't work on a HASH partitioned table. Deleting a partition deletes its subpartitions.

To use the DROP PARTITION clause, you must be the owner of the partitioning root, a member of a group that owns the table, or have database superuser or administrative privileges.

example_deleting_a_partition