A DDL command for removing an index
DROP INDEX is a DDL command for removing an index.
DROP INDEX has always been present in PostgreSQL.
DROP INDEX execution:
postgres=# DROP INDEX ocr_uripart_ix; DROP INDEX
Safely attempting to drop an index which might not exist:
postgres=# DROP INDEX IF EXISTS foo; NOTICE: index "foo" does not exist, skipping DROP INDEX
Attempting to drop an index associated with a constraint:
postgres=# DROP INDEX category_pkey; ERROR: cannot drop index category_pkey because constraint category_pkey on table category requires it HINT: You can drop constraint category_pkey on table category instead.
ALTER INDEX, CREATE INDEX