1DROP INDEX(7)            PostgreSQL 12.6 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. Lastly, indexes on partitioned tables
29           cannot be dropped using this option.
30
31           For temporary tables, DROP INDEX is always non-concurrent, as no
32           other session can access them, and non-concurrent index drop is
33           cheaper.
34
35       IF EXISTS
36           Do not throw an error if the index does not exist. A notice is
37           issued in this case.
38
39       name
40           The name (optionally schema-qualified) of an index to remove.
41
42       CASCADE
43           Automatically drop objects that depend on the index, and in turn
44           all objects that depend on those objects (see Section 5.14).
45
46       RESTRICT
47           Refuse to drop the index if any objects depend on it. This is the
48           default.
49

EXAMPLES

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

COMPATIBILITY

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

SEE ALSO

60       CREATE INDEX (CREATE_INDEX(7))
61
62
63
64PostgreSQL 12.6                      2021                        DROP INDEX(7)
Impressum