DROP_EXTENSION(7pg15)

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

✨ DROP EXTENSION πŸ’…

okay so bestie, welcome to DROP EXTENSION β€” page 7 of the PostgreSQL 15.19 Documentation πŸŽ€ this is the one where you say bye-bye to an extension, and honestly? it's giving cleanup era ✨


🌸 NAME 🌸

DROP EXTENSION β€” remove an extension 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

DROP EXTENSION [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]

like, that's the whole vibe. copy it exactly, no cap πŸ’…


πŸ’– DESCRIPTION πŸ’–

DROP EXTENSION removes extensions from the database. periodt. and here's the tea β€” dropping an extension causes its member objects, and other explicitly dependent routines (see ALTER ROUTINE (ALTER_ROUTINE(7)), the DEPENDS ON EXTENSION extension_name action) to be dropped as well. so yeah, they're going down with the ship 😭 no leaving anyone behind.

⚠️ also, bestie, you must own the extension to use DROP EXTENSION. no ownership, no dropping. rules are rules πŸ‘‘

✨ PARAMETERS ✨

  • IF EXISTS β€” do not throw an error if the extension does not exist. a notice is issued in this case. so instead of a whole dramatic meltdown, you just get a lil heads-up 🫢 very demure.
  • name β€” the name of an installed extension. yup, that's the thing you're yeeting 🌈
  • CASCADE β€” automatically drop objects that depend on the extension, and in turn all objects that depend on those objects (see Section 5.14). full domino effect, main character energy πŸ”₯
  • RESTRICT β€” this option prevents the specified extensions from being dropped if other objects, besides these extensions, their members, and their explicitly dependent routines, depend on them. this is the default. so chill, it's the safe mode πŸ’€

πŸ’œ EXAMPLES πŸ’œ

to remove the extension hstore from the current database:

DROP EXTENSION hstore;

this command will fail if any of hstore's objects are in use in the database, for example if any tables have columns of the hstore type. add the CASCADE option to forcibly remove those dependent objects as well 😭 like yes it's dramatic but sometimes you gotta.


⭐ COMPATIBILITY ⭐

DROP EXTENSION is a PostgreSQL extension. iykyk 🌈


πŸŽ€ SEE ALSO πŸŽ€


okay that's the whole page, you ate that πŸ’… go forth and drop responsibly. sending love from PostgreSQL 15.19, dated 2026 β€” DROP EXTENSION(7) and out πŸ¦‹βœ¨πŸ“

πŸ“¦ where this page comes from