DROP_DOMAIN(7pg17)
π DROP_DOMAIN β the "we're so over, delete the domain" page
okay bestie, this is DROP_DOMAIN from the PostgreSQL 17.11 docs, and it's literally the breakup command for domains. no cap, it's a short one β let's get into it π
β¨ SYNOPSIS β¨
DROP DOMAIN [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
πΈ DESCRIPTION πΈ
DROP DOMAIN removes a domain. that's the whole vibe. but plot twist β only the owner of a domain can remove it. so if you're not the owner, this is giving "you don't have main character energy here" and it will not work π
π¦ PARAMETERS π¦
IF EXISTSβ do not throw an error if the domain does not exist. instead, a notice is issued in this case. it's the chill "no biggie if it's not there" option π«Άnameβ the name (optionally schema-qualified) of an existing domain. this is the one you're β¨ending thingsβ¨ with.CASCADEβ automatically drop objects that depend on the domain (such as table columns), and in turn all objects that depend on those objects (see Section 5.15). it takes everybody down with it, chain reaction style π₯RESTRICTβ refuse to drop the domain if any objects depend on it. this is the default. it's the cautious queen that checks for strings before cutting ties π
π EXAMPLES π
to remove the domain box (saying goodbye, but make it SQL):
DROP DOMAIN box;
β COMPATIBILITY β
this command conforms to the SQL standard, except for the IF EXISTS option, which is a PostgreSQL extension. so like, mostly standard, tiny bit special π
π SEE ALSO π
CREATE DOMAIN(CREATE_DOMAIN(7)) β for when you're ready to commit againALTER DOMAIN(ALTER_DOMAIN(7)) β for when you want to change things, not end them
and that's the page, bestie! π§ source: PostgreSQL 17.11 docs, dated 2026 β mwah π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-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