Updated on 2023-10-23 GMT+08:00

DROP INDEX

Function

DROP INDEX deletes 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. The system administrator has this permission by default.

Syntax

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

Parameter Description

  • 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 deleted.

    Value range: an existing index

  • CASCADE | RESTRICT
    • CASCADE: automatically deletes the objects that depend on the index.
    • RESTRICT: refuses to delete 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