Skip to main content

ALTER INDEX

The ALTER INDEX command modifies the definition of an index.

Syntax

ALTER INDEX index_name 
alter_option;

alter_option depends on the operation you want to perform on the index. For all supported clauses, see the sections below.

Clause

RENAME TO

Syntax
ALTER INDEX index_name 
RENAME TO new_name;
Parameter or clauseDescription
RENAME TOThis clause changes the name of the index. If the index is associated with a table constraint (either UNIQUE, PRIMARY KEY, or EXCLUDE), the constraint is renamed as well. There is no effect on the stored data.
new_nameThe new name of the index.
Example
-- Change the name of the index "idx_1" to "idx_2"
ALTER INDEX idx_1 RENAME TO idx_2.

Help us make this doc better!

Was this page helpful?

Happy React is loading...