DROP_DOMAIN(7pg17)

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

πŸ’… 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 again
  • ALTER 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