DROP_FOREIGN_DATA_WRAPPER(7pg17)
π 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 π
CREATE FOREIGN DATA WRAPPER(CREATE_FOREIGN_DATA_WRAPPER(7))ALTER FOREIGN DATA WRAPPER(ALTER_FOREIGN_DATA_WRAPPER(7))
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
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms