DROP_OPERATOR_FAMILY(7pg15)

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

πŸ’– DROP OPERATOR_FAMILY πŸ’–

okay bestie, this is the DROP OPERATOR FAMILY page from the PostgreSQL 15.19 docs β€” yes, that one. buckle up, it's actually short and slay. πŸŽ€


✨ SYNOPSIS ✨

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

lowkey the whole syntax in one line, we love an efficient queen. πŸ’…


🌸 DESCRIPTION 🌸

DROP OPERATOR FAMILY drops an existing operator family. that's the whole vibe. but listen β€” to actually run this command you must be the owner of the operator family, so no sneaking in, bestie. πŸ”‘

here's the tea though: DROP OPERATOR FAMILY does include dropping any operator classes contained in the family. but it does not drop any of the operators or functions referenced by the family β€” those stay, they're not the problem here. 😌

and if there are any indexes depending on operator classes within the family? you will need to specify CASCADE for the drop to complete. no CASCADE, no drop, fr fr. 🫢


πŸ¦‹ PARAMETERS πŸ¦‹

  • IF EXISTS β€” do not throw an error if the operator family does not exist. a notice is issued in this case instead. it's giving "no drama, just a heads up". πŸ’Œ
  • name β€” the name (optionally schema-qualified) of an existing operator family.
  • index_method β€” the name of the index access method the operator family is for.
  • 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 a whole chain reaction, main character energy. πŸ”₯
  • RESTRICT β€” refuse to drop the operator family if any objects depend on it. this is the default, so if you do nothing, it's a no. πŸ™ˆ

πŸŽ€ EXAMPLES πŸŽ€

remove the B-tree operator family float_ops, iconic name btw:

DROP OPERATOR FAMILY float_ops USING btree;

okay but heads up β€” 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. your choice, but choose wisely bestie. 😭


πŸ’€ COMPATIBILITY πŸ’€

there is no DROP OPERATOR FAMILY statement in the SQL standard. so like... this is a PostgreSQL original. periodt. πŸ’œ


🌈 SEE ALSO 🌈

go read those too, iykyk 🧚


that's the whole page, no cap. this was PostgreSQL 15.19, dated 2026 β€” DROP OPERATOR FAMILY(7) β€” and yes i will be thinking about that CASCADE warning all day. slay safe out there! πŸ’–βœ¨πŸ“

πŸ“¦ where this page comes from