DROP_SERVER(7pg14)
π DROP SERVER π
okay bestie, real talk β this is the DROP SERVER page from the PostgreSQL 14.24 docs (that's the DROP SERVER(7) man page, yes the whole manual-name thing, we're being fancy today β¨). It's short, it's sweet, and it's here to help you yeet a foreign server descriptor into the void. Let's get into it π«Ά
πΈ NAME πΈ
DROP_SERVER β remove a foreign server descriptor
Like, literally just deletes it. Poof. Gone. Main character exit π
β¨ SYNOPSIS β¨
DROP SERVER [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
That's the whole vibe right there. Note the [, ...] β yes queen, you can list multiple servers, the syntax said so π
π¦ DESCRIPTION π¦
DROP SERVER removes an existing foreign server descriptor. That's the whole job description, no hidden lore.
Heads up though β to run this command, the current user must be the owner of the server. No ownership, no dropping. That's the rule, iykyk π₯
π PARAMETERS π
IF EXISTSβ doesn't throw an error if the server doesn't exist. Instead it just issues a notice and moves on with its life. Very unbothered of it honestly πnameβ the name of an existing server. You gotta actually name the thing you're dropping, bestie, we can't read your mind πCASCADEβ automatically drops objects that depend on the server (such as user mappings), and then in turn all objects that depend on those objects. Yes, it cascades. Yes, it keeps going. See Section 5.14 for the full depend-o-rama. βRESTRICTβ refuses to drop the server if any objects depend on it. This is the default, so if you don't say anything, this is what you get. Polite, cautious, lowkey iconic π
π EXAMPLES π
Drop a server foo if it exists:
DROP SERVER IF EXISTS foo;
That's it. That's the example. Chef's kiss π€
π COMPATIBILITY π
DROP SERVER conforms to ISO/IEC 9075-9 (SQL/MED). Standards girlie π
The IF EXISTS clause, however, is a PostgreSQL extension β i.e. our little bonus feature, not part of the standard. Ngl, we ate with that one π
π SEE ALSO π
CREATE SERVER (CREATE_SERVER(7))ALTER SERVER (ALTER_SERVER(7))
The full server lifecycle trilogy, fr fr π§
aaaand that's the page! π this was DROP SERVER(7) from the PostgreSQL 14.24 documentation, dated 2026 β stay slaying, and remember: own the server before you drop the server πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-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