DROP INDEX

Name

DROP INDEX  --  Removes an index from a database.

Synopsis

DROP INDEX index_name [, ...]
  

Parameters

index_name

The sole parameter of this command is the name of the index you wish to remove from the database.

Results

DROP

This message is displayed if the index is removed successfully.

ERROR: index "index_name" nonexistent

This error is displayed if the index specified cannot be found within the database.

Description

The owner of an index may remove it from the database by using this command.

Examples

The index must exist for the DBMS to drop it. Here, we will create an index of customer identification numbers:

CREATE UNIQUE INDEX cust_id_idx
    ON customers (cust_id); 
   

This example will remove the cust_id_idx index.

    DROP INDEX cust_id_idx;