DROP_FOREIGN_DATA_WRAPPER(7pg17)

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

πŸ’… DROP FOREIGN DATA WRAPPER πŸ’…

Okay bestie, welcome to the DROP_FOREIGN_DATA_WRAPPER page β€” that's the 7pg17 one, from the PostgreSQL 17.11 docs. Buckle up, this one's short and sweet, and honestly? Ate. ✨


🌸 NAME 🌸

DROP_FOREIGN_DATA_WRAPPER β€” literally just removes a foreign-data wrapper. That's the whole vibe. 🫢


πŸŽ€ SYNOPSIS πŸŽ€

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

✨ DESCRIPTION ✨

So DROP FOREIGN DATA WRAPPER removes an existing foreign-data wrapper. Simple. Iconic. No notes. πŸ’…

But listen β€” vibe check first: to actually run this command, the current user has to be the owner of the foreign-data wrapper. Not your friend, not your cousin, you. Own it or don't run it, periodt. πŸ‘‘


πŸ”₯ PARAMETERS πŸ”₯

  • IF EXISTS β€” do not throw an error if the foreign-data wrapper doesn't exist. Instead it just issues a notice. So chill. So forgiving. πŸ•ŠοΈ
  • name β€” the name of an existing foreign-data wrapper. That's the one you're yeeting.
  • CASCADE β€” automatically drops objects that depend on the foreign-data wrapper (think foreign tables and servers, bestie), and then in turn all the objects that depend on those objects. It's giving domino effect. See Section 5.15 for the full tea. 😭πŸ”₯
  • RESTRICT β€” refuses to drop the foreign-data wrapper if any objects depend on it. Safe, careful, lowkey the responsible one. This is the default. πŸŽ€
Heads up: CASCADE goes deep β€” it chains through everything depending on the dependents. Know what you're dropping before you drop it, fr fr. πŸ’€

πŸ¦‹ EXAMPLES πŸ¦‹

Wanna drop the foreign-data wrapper named dbi? Say less:

DROP FOREIGN DATA WRAPPER dbi;

🌈 COMPATIBILITY 🌈

DROP FOREIGN DATA WRAPPER conforms to ISO/IEC 9075-9 (SQL/MED) β€” certified standard behavior, we love that for us. πŸ’–

The IF EXISTS clause though? That's a PostgreSQL extension. Homegrown. Main character energy. ✨


πŸ‘‘ SEE ALSO πŸ‘‘


And that's the whole page, bestie β€” no cap, every single detail preserved. 🧚 Mwah! πŸ’œ

PostgreSQL 17.11 Β· 2026 Β· DROP FOREIGN DATA WRAPPER(7) β€” catch you in the next manpage, ily, bye! πŸ“β­

πŸ“¦ where this page comes from