1ALTER OPERATOR(7)        PostgreSQL 11.3 Documentation       ALTER OPERATOR(7)
2
3
4

NAME

6       ALTER_OPERATOR - change the definition of an operator
7

SYNOPSIS

9       ALTER OPERATOR name ( { left_type | NONE } , { right_type | NONE } )
10           OWNER TO { new_owner | CURRENT_USER | SESSION_USER }
11
12       ALTER OPERATOR name ( { left_type | NONE } , { right_type | NONE } )
13           SET SCHEMA new_schema
14
15       ALTER OPERATOR name ( { left_type | NONE } , { right_type | NONE } )
16           SET ( {  RESTRICT = { res_proc | NONE }
17                  | JOIN = { join_proc | NONE }
18                } [, ... ] )
19

DESCRIPTION

21       ALTER OPERATOR changes the definition of an operator.
22
23       You must own the operator to use ALTER OPERATOR. To alter the owner,
24       you must also be a direct or indirect member of the new owning role,
25       and that role must have CREATE privilege on the operator's schema.
26       (These restrictions enforce that altering the owner doesn't do anything
27       you couldn't do by dropping and recreating the operator. However, a
28       superuser can alter ownership of any operator anyway.)
29

PARAMETERS

31       name
32           The name (optionally schema-qualified) of an existing operator.
33
34       left_type
35           The data type of the operator's left operand; write NONE if the
36           operator has no left operand.
37
38       right_type
39           The data type of the operator's right operand; write NONE if the
40           operator has no right operand.
41
42       new_owner
43           The new owner of the operator.
44
45       new_schema
46           The new schema for the operator.
47
48       res_proc
49           The restriction selectivity estimator function for this operator;
50           write NONE to remove existing selectivity estimator.
51
52       join_proc
53           The join selectivity estimator function for this operator; write
54           NONE to remove existing selectivity estimator.
55

EXAMPLES

57       Change the owner of a custom operator a @@ b for type text:
58
59           ALTER OPERATOR @@ (text, text) OWNER TO joe;
60
61       Change the restriction and join selectivity estimator functions of a
62       custom operator a && b for type int[]:
63
64           ALTER OPERATOR && (_int4, _int4) SET (RESTRICT = _int_contsel, JOIN = _int_contjoinsel);
65

COMPATIBILITY

67       There is no ALTER OPERATOR statement in the SQL standard.
68

SEE ALSO

70       CREATE OPERATOR (CREATE_OPERATOR(7)), DROP OPERATOR (DROP_OPERATOR(7))
71
72
73
74PostgreSQL 11.3                      2019                    ALTER OPERATOR(7)
Impressum