DROP_OPERATOR_FAMILY(7pg16)

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

πŸ’… DROP_OPERATOR_FAMILY β€” bestie, we're deleting an operator family ✨

Okay so real talk, this is the DROP OPERATOR FAMILY page from the PostgreSQL 16 docs, and we're gonna get you all the way together on it. No cap, it's short but there's lore. 🫢


🌸 NAME 🌸

DROP_OPERATOR_FAMILY β€” remove an operator family. That's it, that's the whole vibe. πŸ’€


⭐ SYNOPSIS ⭐

DROP OPERATOR FAMILY [ IF EXISTS ] name USING index_method [ CASCADE | RESTRICT ]

Look at her. Iconic. Let's break it down. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

So DROP OPERATOR FAMILY drops an existing operator family. Simple enough, right? But listen β€” to run this command you must be the owner of the operator family. Not your friend, not your cousin, you. πŸ‘‘

Here's the part people miss: DROP OPERATOR FAMILY includes dropping any operator classes contained in the family, but it does not drop any of the operators or functions referenced by the family. So the family goes, the classes inside it go, but the operators and functions it was pointing at? They stay. Lowkey important, highkey a vibe check. 🧚

And if there are any indexes depending on operator classes within the family, you'll need to specify CASCADE for the drop to actually complete. Otherwise it's just gonna sit there and refuse, and honestly? Same. 😭


✨ PARAMETERS ✨

  • IF EXISTS β€” do not throw an error if the operator family does not exist. A notice is issued in this case. Basically "if she's not there, no drama, just a little note." πŸ’Œ
  • name β€” the name (optionally schema-qualified) of an existing operator family. Yes, you can schema-qualify it. Slay. 🌈
  • index_method β€” the name of the index access method the operator family is for. You gotta tell it which method we're talking about. 🎯
  • CASCADE β€” automatically drop objects that depend on the operator family, and in turn all objects that depend on those objects (see Section 5.14). It's giving chain reaction. πŸ’₯
  • RESTRICT β€” refuse to drop the operator family if any objects depend on it. This is the default. She's cautious. She's protected. Periodt. πŸ›‘οΈ

πŸ’– EXAMPLES πŸ’–

Remove the B-tree operator family float_ops:

DROP OPERATOR FAMILY float_ops USING btree;

Now bestie, read this carefully: this command will not succeed if there are any existing indexes that use operator classes within the family. Add CASCADE to drop such indexes along with the operator family. Don't say I didn't warn you. πŸ™ˆ


πŸ”₯ COMPATIBILITY πŸ”₯

There is no DROP OPERATOR FAMILY statement in the SQL standard. So like… we're built different. πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

Go read those too, iykyk. πŸ“šβœ¨


And that's the whole page, bestie! This little masterpiece is from PostgreSQL 16.15, dated 2026, and it's the DROP OPERATOR FAMILY(7) manual page. Go forth and drop responsibly. πŸ“πŸ’œ

πŸ“¦ where this page comes from