DROP_INDEX(7pg16)

πŸ“¦ version 16.15, in opensuse-leap 16.0

πŸ’… DROP_INDEX β€” like, the page about yeeting an index (PostgreSQL 16.15 docs, manual DROP INDEX(7))

okay bestie, so this is the DROP INDEX page from the PostgreSQL 16.15 documentation, and it's honestly so straightforward it's giving comfort food πŸ“. Short page, big "delete that thing" energy.


✨ NAME ✨

DROP_INDEX β€” remove an index. that's it. that's the whole vibe. you point at an index, it stops existing. iconic πŸ’…


🌸 SYNOPSIS 🌸

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

look at those optional brackets, they're all just little accessories πŸŽ€ β€” every one of them is optional, and name is the only thing you actually need.


πŸ¦‹ DESCRIPTION πŸ¦‹

DROP INDEX drops an existing index from the database system. plain and simple. literally just removes it.

but βœ‹ β€” to execute this command you must be the owner of the index. no ownership, no drop. sorry babe, house rules πŸ‘‘


πŸ”₯ PARAMETERS πŸ”₯ (the part you actually came for)

  • CONCURRENTLY β€” drop the index without locking out concurrent selects, inserts, updates, and deletes on the index's table. because a normal DROP INDEX grabs an ACCESS EXCLUSIVE lock on the table, which blocks other accesses until the index drop can be completed 😭. with this option, the command instead waits until conflicting transactions have completed. much more polite. much more main character of it.
okay so there are several caveats to be aware of when using this option, and they are not optional reading, bestie β€” they're the whole plot: - only one index name can be specified 🫢 - the CASCADE option is not supported. (thus, an index that supports a UNIQUE or PRIMARY KEY constraint cannot be dropped this way.) πŸ’€ - regular DROP INDEX commands can be performed within a transaction block, but DROP INDEX CONCURRENTLY cannot πŸ™ˆ - lastly, indexes on partitioned tables cannot be dropped using this option
  • IF EXISTS β€” do not throw an error if the index does not exist. a notice is issued in this case. she's chill like that ✨
  • name β€” the name (optionally schema-qualified) of an index to remove. yes, you can schema-qualify it, slay 🌈
  • CASCADE β€” automatically drop objects that depend on the index, and in turn all objects that depend on those objects (see Section 5.14). it's giving domino effect, so be sure πŸ“
  • RESTRICT β€” refuse to drop the index if any objects depend on it. and guess what: this is the default πŸ‘‘ no accidental yeeting.
🌸 bonus fact that lives in the CONCURRENTLY paragraph but deserves its own little spotlight: for temporary tables, DROP INDEX is always non-concurrent, as no other session can access them, and non-concurrent index drop is cheaper. so don't bother asking, she's already made up her mind πŸ’œ

πŸŽ€ EXAMPLES πŸŽ€

this command will remove the index title_idx:

DROP INDEX title_idx;

one line. zero drama. she ate πŸ”₯


⭐ COMPATIBILITY ⭐

DROP INDEX is a PostgreSQL language extension. there are no provisions for indexes in the SQL standard. so like, other databases? not invited to this party πŸ™ˆ


🌈 SEE ALSO 🌈

  • CREATE INDEX (CREATE_INDEX(7)) β€” the other half of the story, the "put it there" to this page's "take it away" πŸ¦‹

and that's the page, bestie! happy dropping, go be the owner of an index about it πŸ’–

✨ PostgreSQL 16.15 Β· 2026 Β· DROP INDEX(7) ✨ β€” mwah, ty for reading, ily, go touch some indexes (gently) πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from