DROP_DOMAIN(7pg14)

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

πŸ’… DROP DOMAIN(7) β€” the PostgreSQL 14.24 glow-up

okay bestie, so this is a PostgreSQL 14.24 manual page for DROP DOMAIN, and it's genuinely one of the shorter ones so you're gonna eat this UP ✨ (also it lives in section 7 of the manual, hence the (7) β€” iykyk πŸŽ€)


🌸 NAME 🌸

DROP_DOMAIN β€” remove a domain, bestie. that's it. that's the whole vibe check. πŸ¦‹


✨ SYNOPSIS ✨

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

look at that. clean. iconic. no notes. πŸ’…


πŸ’– DESCRIPTION πŸ’–

so DROP DOMAIN removes a domain. periodt. πŸ’€

but listen β€” only the owner of a domain can remove it. not your friend, not your mutual, not the group chat. the owner. so if it's not yours, don't touch it, fr fr πŸ™ˆ


🧚 PARAMETERS 🧚

  • IF EXISTS β€” do not throw an error if the domain doesn't exist. like, be cool about it. instead a notice is issued in this case 🫢 (super handy when you're not sure if it's even there and you don't want the whole script to come crashing down)
  • name β€” the name of an existing domain, optionally schema-qualified. it's the target. the main character. the domain in question πŸ‘‘
  • CASCADE β€” automatically drop objects that depend on the domain (such as table columns), and then, in turn, all objects that depend on those objects. it's giving domino effect πŸ’€ see Section 5.14 β€” the dependency chain is real
  • RESTRICT β€” refuse to drop the domain if any objects depend on it. this is the default, so if you just vibes your way through and don't say anything, this is what you get. lowkey the safe one 🌸
heads up: CASCADE is the chaotic option here β€” it takes everything downstream with it. RESTRICT is the "wait, are you sure?" option and it's the default for a reason, bestie 😭

🌈 EXAMPLES 🌈

to remove the domain box:

DROP DOMAIN box;

look at her go. simple, elegant, slay. ✨


πŸ‘‘ COMPATIBILITY πŸ‘‘

this command conforms to the SQL standard, except for the IF EXISTS option β€” that one is a PostgreSQL extension. so like, it's standards-compliant, she just has a little extra flair πŸŽ€ (and honestly? we love that for her)


πŸ¦‹ SEE ALSO πŸ¦‹

  • CREATE DOMAIN (CREATE_DOMAIN(7)) β€” making the domain in the first place πŸ’–
  • ALTER DOMAIN (ALTER_DOMAIN(7)) β€” changing it up when your needs shift ⭐

and that's the whole page, bestie 🫢 go forth and drop responsibly πŸ’…

β€” xoxo, your girl at PostgreSQL 14.24, dated 2026 πŸŒΈβœ¨πŸŽ€

πŸ“¦ where this page comes from