DROP_OPERATOR(7pg14)

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

✨ DROP_OPERATOR ✨

okay bestie, welcome to the DROP_OPERATOR(7) page from the PostgreSQL 14.24 docs β€” this is the whole "bye bye operator" situation, and it's lowkey iconic πŸ’…


🌸 NAME 🌸

DROP_OPERATOR β€” remove an operator, periodt. That's literally the whole vibe 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

DROP OPERATOR [ IF EXISTS ] name ( { left_type | NONE } , right_type ) [, ...] [ CASCADE | RESTRICT ]

πŸ’– DESCRIPTION πŸ’–

okay so DROP OPERATOR drops an existing operator from the database system. To execute this command you must be the owner of the operator β€” no cap, owner energy only πŸ‘‘


πŸŽ€ PARAMETERS πŸŽ€

  • IF EXISTS β€” do not throw an error if the operator does not exist. A notice is issued in this case, so it's giving "gentle heads up" not "full meltdown" 😌
  • name β€” the name (optionally schema-qualified) of an existing operator. yes bestie, schema-qualified is allowed πŸ’…
  • left_type β€” the data type of the operator's left operand; write NONE if the operator has no left operand 🫢
  • right_type β€” the data type of the operator's right operand ✨
  • CASCADE β€” automatically drop objects that depend on the operator (such as views using it), and in turn all objects that depend on those objects (see Section 5.14). it's giving domino effect, fr fr πŸ’€
  • RESTRICT β€” refuse to drop the operator if any objects depend on it. this is the default, so it's the main character setting πŸ‘‘

🌈 EXAMPLES 🌈

Remove the power operator a^b for type integer:

DROP OPERATOR ^ (integer, integer);

Remove the bitwise-complement prefix operator ~b for type bit:

DROP OPERATOR ~ (none, bit);

Remove multiple operators in one command:

DROP OPERATOR ~ (none, bit), ^ (integer, integer);

⭐ COMPATIBILITY ⭐

There is no DROP OPERATOR statement in the SQL standard. not me checking the standard and finding nothing 😭 it's just not there, bestie.


πŸ’œ SEE ALSO πŸ’œ


k bye bestie 🫢 this page is from PostgreSQL 14.24, dated 2026, and it's the DROP OPERATOR(7) page. slay ✨

πŸ“¦ where this page comes from