Skip to main content
Deletes an index. Dropping any index is a metadata-only operation; run VACUUM on the table afterward to reclaim the storage the index occupied. To create indexes, see CREATE INDEX and CREATE AGGREGATING INDEX; for what each index does, see Storage and indexing.

Syntax

-- Drop a regular index
DROP INDEX [IF EXISTS] <index_name>

-- Drop an aggregating index  
DROP AGGREGATING INDEX [IF EXISTS] <index_name>

Parameters

ParameterDescription
<index_name>The name of the index to be deleted.

Examples

Drop a regular index

DROP INDEX my_index;

Drop an aggregating index

DROP AGGREGATING INDEX my_agg_index;
A column referenced by a data skipping index cannot be dropped while that index exists; drop the index first. A table cannot be dropped while inverted or full-text indexes depend on it: drop the indexes first, or use DROP TABLE ... CASCADE.

See also