DROP_FOREIGN_DATA_WRAPPER(7pg15)

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

πŸ’… NAME πŸ’…

DROP_FOREIGN_DATA_WRAPPER β€” remove a foreign-data wrapper. That’s the whole assignment, bestie: deleting a foreign-data wrapper that already exists. This is manual page 7pg15 for PostgreSQL 15.19 docs, and we are gonna make it make sense 🫢


🌸 SYNOPSIS 🌸

DROP FOREIGN DATA WRAPPER [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]

okay so the grammar is literally right there: optional IF EXISTS, one name, maybe more names via , ..., then choose CASCADE or RESTRICT. No cap, that’s the vibe-check version of the synopsis ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

DROP FOREIGN DATA WRAPPER removes an existing foreign-data wrapper. To execute this command, the current user must be the owner of the foreign-data wrapper. That’s the permission plot twist: owner only, bestie πŸ‘‘


πŸ’– PARAMETERS πŸ’–

  • IF EXISTS β€” Do not throw an error if the foreign-data wrapper does not exist. A notice is issued in this case. It’s giving gentle skip instead of dramatic explosion 😌
  • name β€” The name of an existing foreign-data wrapper. It has to already be a thing, fr fr.
  • CASCADE β€” Automatically drop objects that depend on the foreign-data wrapper (such as foreign tables and servers), and in turn all objects that depend on those objects (see Section 5.14). This is the full chain-reaction energy πŸ”₯
  • RESTRICT β€” Refuse to drop the foreign-data wrapper if any objects depend on it. This is the default. So if you don’t say anything, PostgreSQL is lowkey protective πŸ›‘οΈ

πŸŽ€ EXAMPLES πŸŽ€

Drop the foreign-data wrapper dbi:

DROP FOREIGN DATA WRAPPER dbi;

That’s it. Iconic. One line, no crumbs πŸ’…


🌈 COMPATIBILITY 🌈

DROP FOREIGN DATA WRAPPER conforms to ISO/IEC 9075-9 (SQL/MED). The IF EXISTS clause is a PostgreSQL extension. So yes: standards-approved slay, with a little PostgreSQL-specific sparkle ✨


🫢 SEE ALSO 🫢

Go read these next, bestie β€” iykyk πŸ’œ


byeee 🫢 this was PostgreSQL 15.19, dated 2026. Stay hydrated, and remember: CASCADE has main character energy for a reason πŸ’€βœ¨

πŸ“¦ where this page comes from