The code to unlink dropped relations in FinishPreparedTransaction() was
[PostgreSQL.git] / doc / src / sgml / ref / alter_operator.sgml
bloba6eeb1551f6638da2b8e2858f27314d5285e99cf
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-ALTEROPERATOR">
7 <refmeta>
8 <refentrytitle id="SQL-ALTEROPERATOR-TITLE">ALTER OPERATOR</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
11 </refmeta>
13 <refnamediv>
14 <refname>ALTER OPERATOR</refname>
15 <refpurpose>change the definition of an operator</refpurpose>
16 </refnamediv>
18 <indexterm zone="sql-alteroperator">
19 <primary>ALTER OPERATOR</primary>
20 </indexterm>
22 <refsynopsisdiv>
23 <synopsis>
24 ALTER OPERATOR <replaceable>name</replaceable> ( { <replaceable>lefttype</replaceable> | NONE } , { <replaceable>righttype</replaceable> | NONE } ) OWNER TO <replaceable>newowner</replaceable>
25 </synopsis>
26 </refsynopsisdiv>
28 <refsect1>
29 <title>Description</title>
31 <para>
32 <command>ALTER OPERATOR</command> changes the definition of
33 an operator. The only currently available functionality is to change the
34 owner of the operator.
35 </para>
37 <para>
38 You must own the operator to use <command>ALTER OPERATOR</>.
39 To alter the owner, you must also be a direct or indirect member of the new
40 owning role, and that role must have <literal>CREATE</literal> privilege on
41 the operator's schema. (These restrictions enforce that altering the owner
42 doesn't do anything you couldn't do by dropping and recreating the operator.
43 However, a superuser can alter ownership of any operator anyway.)
44 </para>
45 </refsect1>
47 <refsect1>
48 <title>Parameters</title>
50 <variablelist>
51 <varlistentry>
52 <term><replaceable class="parameter">name</replaceable></term>
53 <listitem>
54 <para>
55 The name (optionally schema-qualified) of an existing operator.
56 </para>
57 </listitem>
58 </varlistentry>
60 <varlistentry>
61 <term><replaceable class="parameter">lefttype</replaceable></term>
62 <listitem>
63 <para>
64 The data type of the operator's left operand; write
65 <literal>NONE</literal> if the operator has no left operand.
66 </para>
67 </listitem>
68 </varlistentry>
70 <varlistentry>
71 <term><replaceable class="parameter">righttype</replaceable></term>
72 <listitem>
73 <para>
74 The data type of the operator's right operand; write
75 <literal>NONE</literal> if the operator has no right operand.
76 </para>
77 </listitem>
78 </varlistentry>
80 <varlistentry>
81 <term><replaceable class="parameter">newowner</replaceable></term>
82 <listitem>
83 <para>
84 The new owner of the operator.
85 </para>
86 </listitem>
87 </varlistentry>
88 </variablelist>
89 </refsect1>
91 <refsect1>
92 <title>Examples</title>
94 <para>
95 Change the owner of a custom operator <literal>a @@ b</literal> for type <type>text</type>:
96 <programlisting>
97 ALTER OPERATOR @@ (text, text) OWNER TO joe;
98 </programlisting>
99 </para>
100 </refsect1>
102 <refsect1>
103 <title>Compatibility</title>
105 <para>
106 There is no <command>ALTER OPERATOR</command> statement in
107 the SQL standard.
108 </para>
109 </refsect1>
111 <refsect1>
112 <title>See Also</title>
114 <simplelist type="inline">
115 <member><xref linkend="sql-createoperator" endterm="sql-createoperator-title"></member>
116 <member><xref linkend="sql-dropoperator" endterm="sql-dropoperator-title"></member>
117 </simplelist>
118 </refsect1>
119 </refentry>