DROP_FOREIGN_DATA_WRAPPER(7pg15)
π 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 π«Ά
CREATE FOREIGN DATA WRAPPER(CREATE_FOREIGN_DATA_WRAPPER(7))ALTER FOREIGN DATA WRAPPER(ALTER_FOREIGN_DATA_WRAPPER(7))
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
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-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