DROP_FOREIGN_DATA_WRAPPER(7pg13)

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

πŸ’… DROP_FOREIGN_DATA_WRAPPER β€” postgresql 13.23 documentation, bestie ✨

okay so real talk, this is the page for DROP_FOREIGN_DATA_WRAPPER from the PostgreSQL 13.23 Documentation, and it's literally the glow-up-and-goodbye command for foreign-data wrappers. let's get into it 🫢


✨ NAME ✨

DROP_FOREIGN_DATA_WRAPPER β€” remove a foreign-data wrapper. that's it, that's the vibe. deleting the thing, no cap πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

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

look at her. iconic. one line, so much power ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so DROP FOREIGN DATA WRAPPER removes an existing foreign-data wrapper. that's the whole assignment, and she ate. πŸ”₯

but bestie, listen β€” to actually execute this command, the current user must be the owner of the foreign-data wrapper. no ownership, no deleting. it's giving main character energy only πŸ”‘


🌸 PARAMETERS 🌸

  • IF EXISTS β€” do not throw an error if the foreign-data wrapper does not exist. instead, a notice is issued in this case. so like, she just quietly lets you know instead of screaming at you 😭 thoughtful queen
  • name β€” the name of an existing foreign-data wrapper. yk, the thing you're yeeting 🎯
  • 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). it's a whole chain reaction, dominoes style πŸ’€ heads up tho, it's a lot
  • RESTRICT β€” refuse to drop the foreign-data wrapper if any objects depend on it. this is the default. she's cautious, she's responsible, we love her πŸ™ˆ
lowkey important: RESTRICT being the default means postgres is not gonna go deleting your whole dependency tree unless you explicitly say CASCADE. protect your data, bestie πŸ’–

πŸ“ EXAMPLES πŸ“

drop the foreign-data wrapper dbi:

DROP FOREIGN DATA WRAPPER dbi;

so clean. so simple. we stan a one-liner πŸ‘‘


🌈 COMPATIBILITY 🌈

DROP FOREIGN DATA WRAPPER conforms to ISO/IEC 9075-9 (SQL/MED). πŸ’―

the IF EXISTS clause is a PostgreSQL extension β€” that part's a little extra, but like, in a good way ✨


πŸ’œ SEE ALSO πŸ’œ

go read those too, iykyk 🧚


and that's the page!! πŸŽ€ this was PostgreSQL 13.23, dated 2025, and the header's officially DROP FOR...A WRAPPER(7) (yes the title got truncated, she's mysterious like that 😭). now go forth and drop responsibly, bestie β€” mwah πŸ’‹πŸŒΈ

πŸ“¦ where this page comes from