1DROP INDEX(7)            PostgreSQL 12.2 Documentation           DROP INDEX(7)
2
3
4

NAME

6       DROP_INDEX - remove an index
7

SYNOPSIS

9       DROP INDEX [ CONCURRENTLY ] [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
10

DESCRIPTION

12       DROP INDEX drops an existing index from the database system. To execute
13       this command you must be the owner of the index.
14

PARAMETERS

16       CONCURRENTLY
17           Drop the index without locking out concurrent selects, inserts,
18           updates, and deletes on the index's table. A normal DROP INDEX
19           acquires exclusive lock on the table, blocking other accesses until
20           the index drop can be completed. With this option, the command
21           instead waits until conflicting transactions have completed.
22
23           There are several caveats to be aware of when using this option.
24           Only one index name can be specified, and the CASCADE option is not
25           supported. (Thus, an index that supports a UNIQUE or PRIMARY KEY
26           constraint cannot be dropped this way.) Also, regular DROP INDEX
27           commands can be performed within a transaction block, but DROP
28           INDEX CONCURRENTLY cannot.
29
30           For temporary tables, DROP INDEX is always non-concurrent, as no
31           other session can access them, and non-concurrent index drop is
32           cheaper.
33
34       IF EXISTS
35           Do not throw an error if the index does not exist. A notice is
36           issued in this case.
37
38       name
39           The name (optionally schema-qualified) of an index to remove.
40
41       CASCADE
42           Automatically drop objects that depend on the index, and in turn
43           all objects that depend on those objects (see Section 5.14).
44
45       RESTRICT
46           Refuse to drop the index if any objects depend on it. This is the
47           default.
48

EXAMPLES

50       This command will remove the index title_idx:
51
52           DROP INDEX title_idx;
53

COMPATIBILITY

55       DROP INDEX is a PostgreSQL language extension. There are no provisions
56       for indexes in the SQL standard.
57

SEE ALSO

59       CREATE INDEX (CREATE_INDEX(7))
60
61
62
63PostgreSQL 12.2                      2020                        DROP INDEX(7)
Impressum