DROP_DOMAIN(7pg13)
okay so bestie, welcome to the DROP DOMAIN(7) page from the PostgreSQL 13.23 Documentation π
β¨ NAME β¨
DROP DOMAIN β remove a domain. Thatβs the whole name, no cap.
π¦ SYNOPSIS π¦
Hereβs the syntax, copy it exactly because syntax is not a vibe you freestyle:
DROP DOMAIN [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
π DESCRIPTION π
So DROP DOMAIN removes a domain. Literally its whole job. Important vibe check though: only the owner of a domain can remove it. If youβre not the owner, this is not your main character moment β you canβt just delete someone elseβs domain. Periodt.
π PARAMETERS π
IF EXISTSβ Do not throw an error if the domain does not exist. A notice is issued in this case instead. Very chill, no dramatic exit πnameβ The name of an existing domain, and yes it can be optionally schema-qualified. So you can point at exactly the domain you mean, iykyk.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.14). This is the βtake the dependents down with itβ option, so highkey be careful πRESTRICTβ Refuse to drop the domain if any objects depend on it. This is the default, so if you donβt pickCASCADE,RESTRICTis already the vibe.
πΈ EXAMPLES πΈ
To remove the domain box:
DROP DOMAIN box;
Thatβs it. Thatβs the example. Slay β¨
β COMPATIBILITY β
This command conforms to the SQL standard, bestie β except for the IF EXISTS option, which is a PostgreSQL extension. So that little safety net is very PostgreSQL, not standard SQL. Iykyk π«Ά
π SEE ALSO π
CREATE DOMAIN (CREATE_DOMAIN(7))ALTER DOMAIN (ALTER_DOMAIN(7))
okay thatβs the whole page, bestie! This was PostgreSQL 13.23, dated 2025, and the page is DROP DOMAIN(7). Mwah πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql13 13.23-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