DROP_EXTENSION(7pg16)

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

πŸ’… DROP EXTENSION(7) β€” the DROP EXTENSION page, bestie edition

okay so this is the manual page for DROP EXTENSION, from the PostgreSQL 16.15 docs. yes it's a whole page about deleting one thing. no it's not boring. sit down, we're learning. πŸŽ€


✨ NAME ✨

DROP_EXTENSION β€” remove an extension πŸ—‘οΈβœ¨

✨ SYNOPSIS ✨

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

look at her. so clean. so powerful. πŸ’…

✨ DESCRIPTION ✨

DROP EXTENSION removes extensions from the database. like, yeets them. gone.

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, the whole friend group leaves together β€” it's giving main character with a very loyal entourage. 🫢

the vibe check: you must own the extension to use DROP EXTENSION. no ownership, no dropping. periodt. πŸ‘‘

✨ PARAMETERS ✨

  • IF EXISTS β€” do not throw an error if the extension does not exist. a notice is issued in this case. it's the "if you're there, hey; if not, no stress" of options. 🌸
  • name β€” the name of an installed extension. that's the one you're dropping, bestie. πŸ’–
  • CASCADE β€” automatically drop objects that depend on the extension, and in turn all objects that depend on those objects (see Section 5.14). it's the domino effect. one falls, they all fall. πŸ”₯
  • 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. she's the cautious one. the sensible one. the designated driver of options. πŸ¦‹

✨ 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 β€” hstore is in use, she's booked and busy, you can't just delete her. add CASCADE if you truly want chaos and everyone goes down with the ship. πŸ’€

✨ COMPATIBILITY ✨

DROP EXTENSION is a PostgreSQL extension. yup, it's a PostgreSQL original. homegrown. iconic. πŸ‘‘

✨ SEE ALSO ✨


that's the whole page!! you ate that. go drop some extensions responsibly. πŸ§šπŸ’œ

sign-off szn: this was PostgreSQL 16.15, dated 2026 β€” mwah, see you in the next manpage bestie πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from