]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/alter_operator.sgml
Add support for piping COPY to/from an external program.
[postgresql] / doc / src / sgml / ref / alter_operator.sgml
1 <!--
2 doc/src/sgml/ref/alter_operator.sgml
3 PostgreSQL documentation
4 -->
5
6 <refentry id="SQL-ALTEROPERATOR">
7  <refmeta>
8   <refentrytitle>ALTER OPERATOR</refentrytitle>
9   <manvolnum>7</manvolnum>
10   <refmiscinfo>SQL - Language Statements</refmiscinfo>
11  </refmeta>
12
13  <refnamediv>
14   <refname>ALTER OPERATOR</refname>
15   <refpurpose>change the definition of an operator</refpurpose>
16  </refnamediv>
17
18  <indexterm zone="sql-alteroperator">
19   <primary>ALTER OPERATOR</primary>
20  </indexterm>
21
22  <refsynopsisdiv>
23 <synopsis>
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>
26 </synopsis>
27  </refsynopsisdiv>
28
29  <refsect1>
30   <title>Description</title>
31
32   <para>
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.
36   </para>
37
38   <para>
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.)
45   </para>
46  </refsect1>
47
48  <refsect1>
49   <title>Parameters</title>
50
51   <variablelist>
52    <varlistentry>
53     <term><replaceable class="parameter">name</replaceable></term>
54     <listitem>
55      <para>
56       The name (optionally schema-qualified) of an existing operator.
57      </para>
58     </listitem>
59    </varlistentry>
60
61    <varlistentry>
62     <term><replaceable class="parameter">left_type</replaceable></term>
63     <listitem>
64      <para>
65       The data type of the operator's left operand; write
66       <literal>NONE</literal> if the operator has no left operand.
67      </para>
68     </listitem>
69    </varlistentry>
70
71    <varlistentry>
72     <term><replaceable class="parameter">right_type</replaceable></term>
73     <listitem>
74      <para>
75       The data type of the operator's right operand; write
76       <literal>NONE</literal> if the operator has no right operand.
77      </para>
78     </listitem>
79    </varlistentry>
80
81    <varlistentry>
82     <term><replaceable class="parameter">new_owner</replaceable></term>
83     <listitem>
84      <para>
85       The new owner of the operator.
86      </para>
87     </listitem>
88    </varlistentry>
89
90    <varlistentry>
91     <term><replaceable class="parameter">new_schema</replaceable></term>
92     <listitem>
93      <para>
94       The new schema for the operator.
95      </para>
96     </listitem>
97    </varlistentry>
98   </variablelist>
99  </refsect1>
100
101  <refsect1>
102   <title>Examples</title>
103
104   <para>
105    Change the owner of a custom operator <literal>a @@ b</literal> for type <type>text</type>:
106 <programlisting>
107 ALTER OPERATOR @@ (text, text) OWNER TO joe;
108 </programlisting></para>
109  </refsect1>
110
111  <refsect1>
112   <title>Compatibility</title>
113
114   <para>
115    There is no <command>ALTER OPERATOR</command> statement in
116    the SQL standard.
117   </para>
118  </refsect1>
119
120  <refsect1>
121   <title>See Also</title>
122
123   <simplelist type="inline">
124    <member><xref linkend="sql-createoperator"></member>
125    <member><xref linkend="sql-dropoperator"></member>
126   </simplelist>
127  </refsect1>
128 </refentry>