DROP_FOREIGN_DATA_WRAPPER(7pg16)

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

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

okay so bestie, welcome to the DROP_FOREIGN_DATA_WRAPPER page from the PostgreSQL 16.15 Documentation πŸ’– yes that's the manual name, we're not copying the header line verbatim, we're just gonna vibe with it, mwah.


✨ NAME ✨

DROP_FOREIGN_DATA_WRAPPER β€” remove a foreign-data wrapper πŸ—‘οΈβœ¨ like, literally yeet it, no cap.


🫢 SYNOPSIS 🫢

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

look at her. iconic. one line, so much power πŸ”₯


🌸 DESCRIPTION 🌸

Okay so here's the tea 🍡: DROP FOREIGN DATA WRAPPER removes an existing foreign-data wrapper. That's it, that's the whole vibe.

but β€” and this is the part where you gotta pay attention, bestie β€” to execute this command, the current user must be the owner of the foreign-data wrapper πŸ‘‘. no ownership, no dropping. it's giving main character energy and the main character is whoever owns the wrapper, fr fr.


πŸŽ€ PARAMETERS πŸŽ€

  • IF EXISTS β€” do not throw an error if the foreign-data wrapper does not exist πŸ™ˆ. a notice is issued in this case, so like, it'll still tell you in a gentle little whisper instead of screaming at you.
  • name β€” the name of an existing foreign-data wrapper ✨. you know, the thing you're dropping. that one.
  • 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) πŸ’€. yes, it's a whole chain reaction. it takes everything down with it. read that twice, ngl.
  • RESTRICT β€” refuse to drop the foreign-data wrapper if any objects depend on it πŸ›‘. this is the default. you have to opt in to chaos, it won't happen by accident bestie 🫢.

🌈 EXAMPLES 🌈

drop the foreign-data wrapper dbi:

DROP FOREIGN DATA WRAPPER dbi;

that's the whole example, she's short, she's cute, she gets the job done πŸ’…


⭐ COMPATIBILITY ⭐

DROP FOREIGN DATA WRAPPER conforms to ISO/IEC 9075-9 (SQL/MED) πŸ₯³ standard-compliant queen behavior.

the IF EXISTS clause is a PostgreSQL extension though β€” so that bit is our little extra, iykyk πŸ’œ


πŸ¦‹ SEE ALSO πŸ¦‹


and that's the whole page bestie, go forth and drop responsibly πŸ’–

PostgreSQL 16.15 Β· 2026 Β· DROP FOREIGN DATA WRAPPER(7) β€” mwah, love u, bye πŸŽ€βœ¨

πŸ“¦ where this page comes from