DROP_COLLATION(7pg13)

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

πŸ’… DROP COLLATION (7pg13) β€” the PostgreSQL 13.23 glow-up edition ✨

okay bestie, so this is the DROP COLLATION page from the PostgreSQL 13.23 docs, and honestly? it's a short one, but she's iconic. let's get into it πŸŽ€


🌸 NAME 🌸

DROP_COLLATION β€” remove a collation. that's it. that's the whole vibe. we're deleting a collation, no cap πŸ’€


✨ SYNOPSIS ✨

DROP COLLATION [ IF EXISTS ] name [ CASCADE | RESTRICT ]

look at her. so clean. so simple. main character energy fr 🫢


πŸ’– DESCRIPTION πŸ’–

so DROP COLLATION removes a previously defined collation. like, it's gone. bye. πŸ‘‹

but here's the catch, and it's giving gatekeeping honestly: to be able to drop a collation, you must own the collation. not your friend, not your cousin, you. own it or don't touch it, periodt πŸ‘‘


πŸ¦‹ PARAMETERS πŸ¦‹

  • IF EXISTS β€” do not throw an error if the collation does not exist. instead a notice is issued in this case. she's chill like that, no drama, just a little "hey btw it wasn't there" πŸ’…
  • name β€” the name of the collation. and yes, the collation name can be schema-qualified. go off with your schema.name ✨
  • CASCADE β€” automatically drop objects that depend on the collation, and in turn all objects that depend on those objects (see Section 5.14). it's giving "and your little dog too" 😭 careful, she's thorough.
  • RESTRICT β€” refuse to drop the collation if any objects depend on it. and this one? this is the default. she's the cautious friend. love her for it πŸ™ˆ

πŸ“ EXAMPLES πŸ“

to drop the collation named german:

DROP COLLATION german;

one line. one collation. gone. slay πŸ”₯


🌈 COMPATIBILITY 🌈

the DROP COLLATION command conforms to the SQL standard πŸ’– β€” apart from the IF EXISTS option, which is a PostgreSQL extension. so like, mostly standard, just a lil extra seasoning from Postgres. iykyk 🌸


🧚 SEE ALSO 🧚


ngl bestie, quick recap so you never forget: own the collation to drop it, IF EXISTS = no error + a notice, CASCADE takes dependent stuff with it, and RESTRICT is the default and will straight up refuse πŸ’€

okay that's the page!! make sure to check out ALTER_COLLATION(7) and CREATE_COLLATION(7) too, they're the siblings and they're also iconic 🫢

mwah πŸ’‹ β€” this has been PostgreSQL 13.23, 2025, DROP COLLATION (7). go drop something responsibly, queen πŸ‘‘

πŸ“¦ where this page comes from