2 doc/src/sgml/ref/alter_operator.sgml
3 PostgreSQL documentation
6 <refentry id="SQL-ALTEROPERATOR">
8 <refentrytitle>ALTER OPERATOR</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
14 <refname>ALTER OPERATOR</refname>
15 <refpurpose>change the definition of an operator</refpurpose>
18 <indexterm zone="sql-alteroperator">
19 <primary>ALTER OPERATOR</primary>
24 ALTER OPERATOR <replaceable>name</replaceable> ( { <replaceable>left_type</replaceable> | NONE } , { <replaceable>right_type</replaceable> | NONE } ) OWNER TO <replaceable>new_owner</replaceable>
25 ALTER OPERATOR <replaceable>name</replaceable> ( { <replaceable>left_type</replaceable> | NONE } , { <replaceable>right_type</replaceable> | NONE } ) SET SCHEMA <replaceable>new_schema</replaceable>
30 <title>Description</title>
33 <command>ALTER OPERATOR</command> changes the definition of
34 an operator. The only currently available functionality is to change the
35 owner of the operator.
39 You must own the operator to use <command>ALTER OPERATOR</>.
40 To alter the owner, you must also be a direct or indirect member of the new
41 owning role, and that role must have <literal>CREATE</literal> privilege on
42 the operator's schema. (These restrictions enforce that altering the owner
43 doesn't do anything you couldn't do by dropping and recreating the operator.
44 However, a superuser can alter ownership of any operator anyway.)
49 <title>Parameters</title>
53 <term><replaceable class="parameter">name</replaceable></term>
56 The name (optionally schema-qualified) of an existing operator.
62 <term><replaceable class="parameter">left_type</replaceable></term>
65 The data type of the operator's left operand; write
66 <literal>NONE</literal> if the operator has no left operand.
72 <term><replaceable class="parameter">right_type</replaceable></term>
75 The data type of the operator's right operand; write
76 <literal>NONE</literal> if the operator has no right operand.
82 <term><replaceable class="parameter">new_owner</replaceable></term>
85 The new owner of the operator.
91 <term><replaceable class="parameter">new_schema</replaceable></term>
94 The new schema for the operator.
102 <title>Examples</title>
105 Change the owner of a custom operator <literal>a @@ b</literal> for type <type>text</type>:
107 ALTER OPERATOR @@ (text, text) OWNER TO joe;
108 </programlisting></para>
112 <title>Compatibility</title>
115 There is no <command>ALTER OPERATOR</command> statement in
121 <title>See Also</title>
123 <simplelist type="inline">
124 <member><xref linkend="sql-createoperator"></member>
125 <member><xref linkend="sql-dropoperator"></member>