DROP_SERVER(7pg13)

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

πŸ’… DROP SERVER πŸ’…

okay so this is the DROP SERVER page from the PostgreSQL 13.23 docs (manual section 7, bestie, we're in the SQL command pages) β€” and it's literally all about yeeting a foreign server descriptor out of existence. that's it. that's the whole vibe. let's get into it 🫢


✨ NAME ✨

DROP_SERVER β€” remove a foreign server descriptor πŸ—‘οΈβœ¨

🌸 SYNOPSIS 🌸

DROP SERVER [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]

πŸ’– DESCRIPTION πŸ’–

so DROP SERVER removes an existing foreign server descriptor. gone. deleted. no cap.

but bestie, listen β€” to run this command, the current user must be the owner of the server. if that's not you, this is not your moment, and postgres will let you know πŸ˜­πŸ‘‘

πŸ¦‹ PARAMETERS πŸ¦‹

  • IF EXISTS β€” don't throw an error if the server doesn't exist. instead a notice gets issued in this case. it's giving "no drama, just a lil note" πŸ’Œ
  • name β€” the name of an existing server. you know, the one you're about to drop πŸ‘€
  • CASCADE β€” automatically drop objects that depend on the server (such as user mappings), and in turn all objects that depend on those objects (see Section 5.14). it's a whole chain reaction, main character energy, everything downstream goes too πŸ’€πŸ”₯
  • RESTRICT β€” refuse to drop the server if any objects depend on it. this is the default, so if you don't say anything, postgres is gonna be protective and say nope πŸ™ˆ
fr fr though β€” CASCADE is the dramatic one. it takes the dependents with it. know what you're dropping before you drop it πŸ’…

⭐ EXAMPLES ⭐

drop a server foo if it exists:

DROP SERVER IF EXISTS foo;

iconic. clean. no errors if foo ghosted us already ✨

🌈 COMPATIBILITY 🌈

DROP SERVER conforms to ISO/IEC 9075-9 (SQL/MED). the IF EXISTS clause is a PostgreSQL extension β€” so that part's our homegrown slay πŸŽ€

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the page!! πŸ§šπŸ’œ this lil masterpiece comes to you from PostgreSQL 13.23, dated 2025, and it lives at DROP SERVER(7) in the manual. go forth and drop responsibly, bestie πŸ“πŸ«Ά

πŸ“¦ where this page comes from