4 ALTER OPERATOR — change the definition of an operator
8 ALTER OPERATOR name ( { left_type | NONE } , right_type )
9 OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
11 ALTER OPERATOR name ( { left_type | NONE } , right_type )
14 ALTER OPERATOR name ( { left_type | NONE } , right_type )
15 SET ( { RESTRICT = { res_proc | NONE }
16 | JOIN = { join_proc | NONE }
25 ALTER OPERATOR changes the definition of an operator.
27 You must own the operator to use ALTER OPERATOR. To alter the owner,
28 you must be able to SET ROLE to the new owning role, and that role must
29 have CREATE privilege on the operator's schema. (These restrictions
30 enforce that altering the owner doesn't do anything you couldn't do by
31 dropping and recreating the operator. However, a superuser can alter
32 ownership of any operator anyway.)
37 The name (optionally schema-qualified) of an existing operator.
40 The data type of the operator's left operand; write NONE if the
41 operator has no left operand.
44 The data type of the operator's right operand.
47 The new owner of the operator.
50 The new schema for the operator.
53 The restriction selectivity estimator function for this
54 operator; write NONE to remove existing selectivity estimator.
57 The join selectivity estimator function for this operator; write
58 NONE to remove existing selectivity estimator.
61 The commutator of this operator. Can only be changed if the
62 operator does not have an existing commutator.
65 The negator of this operator. Can only be changed if the
66 operator does not have an existing negator.
69 Indicates this operator can support a hash join. Can only be
70 enabled and not disabled.
73 Indicates this operator can support a merge join. Can only be
74 enabled and not disabled.
78 Refer to Section 36.14 and Section 36.15 for further information.
80 Since commutators come in pairs that are commutators of each other,
81 ALTER OPERATOR SET COMMUTATOR will also set the commutator of the
82 com_op to be the target operator. Likewise, ALTER OPERATOR SET NEGATOR
83 will also set the negator of the neg_op to be the target operator.
84 Therefore, you must own the commutator or negator operator as well as
89 Change the owner of a custom operator a @@ b for type text:
90 ALTER OPERATOR @@ (text, text) OWNER TO joe;
92 Change the restriction and join selectivity estimator functions of a
93 custom operator a && b for type int[]:
94 ALTER OPERATOR && (int[], int[]) SET (RESTRICT = _int_contsel, JOIN = _int_contj
97 Mark the && operator as being its own commutator:
98 ALTER OPERATOR && (int[], int[]) SET (COMMUTATOR = &&);
102 There is no ALTER OPERATOR statement in the SQL standard.
106 CREATE OPERATOR, DROP OPERATOR