DROP_OPERATOR(7pg16)
π DROP_OPERATOR, but make it cute π
okay bestie, welcome to the DROP_OPERATOR page from the PostgreSQL 16.15 docs π this is the command that removes an operator from the database system, and yes it's giving "cleanup era" β¨
β¨ NAME β¨
DROP_OPERATOR β remove an operator π
π¦ SYNOPSIS π¦
DROP OPERATOR [ IF EXISTS ] name ( { left_type | NONE } , right_type ) [, ...] [ CASCADE | RESTRICT ]
lowkey just look at that syntax, she's iconic π«Ά
πΈ DESCRIPTION πΈ
DROP_OPERATOR drops an existing operator from the database system. no cap. To execute this command, you must be the owner of the operator β main character permissions only, bestie π
π PARAMETERS π
IF EXISTSβ do not throw an error if the operator does not exist. a notice is issued in this case, so it's like a gentle little "hmm, not here" π¬nameβ the name (optionally schema-qualified) of an existing operator.left_typeβ the data type of the operator's left operand; writeNONEif 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, handle with care πRESTRICTβ refuse to drop the operator if any objects depend on it. this is the default, so she's cautious by nature π
π 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);
ate, no crumbs π₯
π COMPATIBILITY π
There is no DROP OPERATOR statement in the SQL standard. so this is very much a PostgreSQL-specific slay π
π SEE ALSO π
CREATE OPERATOR(CREATE_OPERATOR(7))ALTER OPERATOR(ALTER_OPERATOR(7))
π and that's the whole DROP_OPERATOR page, bestie β from the PostgreSQL 16.15 docs, dated 2026. now go forth and drop operators responsibly π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql16 16.15-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms