DROP INDEX
DROP INDEX removes an index definition and its rebuildable storage.
Synopsis
Section titled “Synopsis”DROP INDEX [IF EXISTS] index_name ON table_nameDescription
Section titled “Description”The 1.2 execution contract requires the ON table clause even though the parser can represent an omitted table name. IF EXISTS suppresses a missing-index error.
Parameters
Section titled “Parameters”index_name identifies the index and table_name fixes its owning table.
Result
Section titled “Result”Success returns a command result with no rows. SHOW INDEXES confirms the remaining definitions.
Transaction behavior
Section titled “Transaction behavior”Index removal is transactional. ROLLBACK keeps the prior index visible.
Errors and limitations
Section titled “Errors and limitations”Omitting ON table_name is rejected in 1.2. A mismatched table, missing index
without IF EXISTS, or attempt to remove an implicit primary-key structure fails.
Privileges
Section titled “Privileges”The effective Principal must own the index; the session also needs CONNECT.
Example
Section titled “Example”CREATE TABLE ref_drop_index (id INTEGER PRIMARY KEY, code TEXT);CREATE INDEX ref_drop_code_idx ON ref_drop_index (code) USING BTREE;DROP INDEX ref_drop_code_idx ON ref_drop_index;SHOW INDEXES FROM ref_drop_index;See also
Section titled “See also”See Indexes, CREATE INDEX and ALTER INDEX.