ALTER_INDEX
change the definition of an index
- Provided by: postgres-xc-client (Version: 1.1-2ubuntu2)
- Source: postgres-xc
- Report a bug
change the definition of an index
ALTER INDEX [ IF EXISTS ] name RENAME TO new_name ALTER INDEX [ IF EXISTS ] name SET TABLESPACE tablespace_name ALTER INDEX [ IF EXISTS ] name SET ( storage_parameter = value [, ... ] ) ALTER INDEX [ IF EXISTS ] name RESET ( storage_parameter [, ... ] )
The following description applies both to Postgres-XC and PostgreSQL if not described explicitly.
ALTER INDEX changes the definition of an existing index. There are several subforms:
IF EXISTS
RENAME
SET TABLESPACE
SET ( storage_parameter = value [, ... ] )
RESET ( storage_parameter [, ... ] )
name
new_name
tablespace_name
storage_parameter
value
These operations are also possible using ALTER TABLE (ALTER_TABLE(7)). ALTER INDEX is in fact just an alias for the forms of ALTER TABLE that apply to indexes.
There was formerly an ALTER INDEX OWNER variant, but this is now ignored (with a warning). An index cannot have an owner different from its table's owner. Changing the table's owner automatically changes the index as well.
Changing any part of a system catalog index is not permitted.
To rename an existing index:
ALTER INDEX distributors RENAME TO suppliers;
To move an index to a different tablespace:
ALTER INDEX distributors SET TABLESPACE fasttablespace;
To change an index's fill factor (assuming that the index method supports it):
ALTER INDEX distributors SET (fillfactor = 75); REINDEX INDEX distributors;
ALTER INDEX is a Postgres-XC extension.
CREATE INDEX (CREATE_INDEX(7)), REINDEX(7)