DROP_FOREIGN_DATA_WRAPPER(7pg16)
π 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 π¦
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, go forth and drop responsibly π
PostgreSQL 16.15 Β· 2026 Β· DROP FOREIGN DATA WRAPPER(7) β mwah, love u, bye πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-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