Updated on 2025-02-27 GMT+08:00

DROP INDEX

Description

Drops an index.

Precautions

Only the index owner, a user of a schema where the index resides, or a user who has the INDEX permission on the table where the index resides can run the DROP INDEX command. System administrators have this permission by default.

For a global temporary table, if a session has initialized a global temporary table object (including creating a global temporary table and inserting data into the global temporary table for the first time), other sessions cannot drop indexes from the table.

Syntax

DROP INDEX [ CONCURRENTLY ] [ IF EXISTS ] 
    index_name [, ...] [ CASCADE | RESTRICT ];

Parameters

  • CONCURRENTLY

    Drops an index without locking it. When an index is dropped, other statements cannot access the table on which the index depends. With this option, the statement does not lock the table during index deletion.

    This parameter allows only one index name and does not support CASCADE.

    The DROP INDEX statement can be run within a transaction, but DROP INDEX CONCURRENTLY cannot.

  • IF EXISTS

    Reports a notice instead of an error if the specified index does not exist.

  • index_name

    Specifies the name of the index to be dropped.

    Value range: name of an existing index.

  • CASCADE | RESTRICT
    • CASCADE: automatically drops the objects that depend on the index.
    • RESTRICT: refuses to drop the index if any objects depend on it. This is the default action.

Examples

See Examples in "CREATE INDEX."

Helpful Links

ALTER INDEX and CREATE INDEX