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