RefLib

Reference library for AI

Back

postgresql_16:7.1.14.4 Examples

PostgreSQL 16 > Reference > SQL Commands > ALTER INDEX > Examples

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;

Set the statistics-gathering target for an expression index: CREATE INDEX coord_idx ON measured (x, y, (z + t)); ALTER INDEX coord_idx ALTER COLUMN 3 SET STATISTICS 1000;

Back