DROP_DOMAIN(7pg15)

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

πŸ’… DROP DOMAIN(7) β€” the drop_domain page, bestie

okay so real talk: this is page DROP DOMAIN(7) from the PostgreSQL 15.19 docs, and it's literally the glow-up-and-goodbye page for domains. let's get into it ✨


πŸŽ€ NAME πŸŽ€

DROP_DOMAIN β€” remove a domain. yeah. that's the whole vibe. deleting it. gone. πŸ’€


✨ SYNOPSIS ✨

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

that's it. that's the whole spell. cast it and the domain is over 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

DROP DOMAIN removes a domain. simple as. but here's the catch, and it's giving "you're not the owner, you're a guest":

Only the owner of a domain can remove it. βœ‹

no owner energy? no deletion energy. periodt.


🌸 PARAMETERS 🌸 (the part you actually need)

  • IF EXISTS β€” do not throw an error if the domain does not exist. instead a notice gets issued in this case, which is the polite little "hey, there was nothing there bestie" of the SQL world πŸ‘‘
  • name β€” the name (optionally schema-qualified) of an existing domain. that's your target, main character of this operation πŸ’…
  • 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). lowkey this is the chain-reaction option, it takes everything downstream with it 😭
  • RESTRICT β€” refuse to drop the domain if any objects depend on it. this is the default. very much the "nope, not touching that, something's attached" setting 🧚
heads up bestie: CASCADE is not a joke β€” it cascades. it drops dependent objects and then the objects depending on those. if you don't want that, RESTRICT is already the default and it's already got your back.

πŸ“ EXAMPLES πŸ“

to remove the domain box:

DROP DOMAIN box;

iconic. bye box. πŸ‘‹ ate and left no crumbs.


🌈 COMPATIBILITY 🌈

this command conforms to the SQL standard, except for the IF EXISTS option, which is a PostgreSQL extension. so basically standard-coded with one lil PostgreSQL exclusive ✨ iykyk.


πŸ”₯ SEE ALSO πŸ”₯


and that's the page, bestie 🫢 go forth and drop responsibly.

this masterpiece brought to you by PostgreSQL 15.19, dated 2026, page DROP DOMAIN(7) β€” stay hydrated, back up your schemas, and don't CASCADE on a Friday πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from