1<!--
2doc/src/sgml/ref/alter_opclass.sgml
3PostgreSQL documentation
4-->
5
6<refentry id="sql-alteropclass">
7 <indexterm zone="sql-alteropclass">
8  <primary>ALTER OPERATOR CLASS</primary>
9 </indexterm>
10
11 <refmeta>
12  <refentrytitle>ALTER OPERATOR CLASS</refentrytitle>
13  <manvolnum>7</manvolnum>
14  <refmiscinfo>SQL - Language Statements</refmiscinfo>
15 </refmeta>
16
17 <refnamediv>
18  <refname>ALTER OPERATOR CLASS</refname>
19  <refpurpose>change the definition of an operator class</refpurpose>
20 </refnamediv>
21
22 <refsynopsisdiv>
23<synopsis>
24ALTER OPERATOR CLASS <replaceable>name</replaceable> USING <replaceable class="parameter">index_method</replaceable>
25    RENAME TO <replaceable>new_name</replaceable>
26
27ALTER OPERATOR CLASS <replaceable>name</replaceable> USING <replaceable class="parameter">index_method</replaceable>
28    OWNER TO { <replaceable>new_owner</replaceable> | CURRENT_USER | SESSION_USER }
29
30ALTER OPERATOR CLASS <replaceable>name</replaceable> USING <replaceable class="parameter">index_method</replaceable>
31    SET SCHEMA <replaceable>new_schema</replaceable>
32</synopsis>
33 </refsynopsisdiv>
34
35 <refsect1>
36  <title>Description</title>
37
38  <para>
39   <command>ALTER OPERATOR CLASS</command> changes the definition of
40   an operator class.
41  </para>
42
43  <para>
44   You must own the operator class to use <command>ALTER OPERATOR CLASS</command>.
45   To alter the owner, you must also be a direct or indirect member of the new
46   owning role, and that role must have <literal>CREATE</literal> privilege on
47   the operator class's schema.  (These restrictions enforce that altering the
48   owner doesn't do anything you couldn't do by dropping and recreating the
49   operator class.  However, a superuser can alter ownership of any operator
50   class anyway.)
51  </para>
52 </refsect1>
53
54 <refsect1>
55  <title>Parameters</title>
56
57  <variablelist>
58   <varlistentry>
59    <term><replaceable class="parameter">name</replaceable></term>
60    <listitem>
61     <para>
62      The name (optionally schema-qualified) of an existing operator
63      class.
64     </para>
65    </listitem>
66   </varlistentry>
67
68   <varlistentry>
69    <term><replaceable class="parameter">index_method</replaceable></term>
70    <listitem>
71     <para>
72      The name of the index method this operator class is for.
73     </para>
74    </listitem>
75   </varlistentry>
76
77   <varlistentry>
78    <term><replaceable class="parameter">new_name</replaceable></term>
79    <listitem>
80     <para>
81      The new name of the operator class.
82     </para>
83    </listitem>
84   </varlistentry>
85
86   <varlistentry>
87    <term><replaceable class="parameter">new_owner</replaceable></term>
88    <listitem>
89     <para>
90      The new owner of the operator class.
91     </para>
92    </listitem>
93   </varlistentry>
94
95   <varlistentry>
96    <term><replaceable class="parameter">new_schema</replaceable></term>
97    <listitem>
98     <para>
99      The new schema for the operator class.
100     </para>
101    </listitem>
102   </varlistentry>
103 </variablelist>
104 </refsect1>
105
106 <refsect1>
107  <title>Compatibility</title>
108
109  <para>
110   There is no <command>ALTER OPERATOR CLASS</command> statement in
111   the SQL standard.
112  </para>
113 </refsect1>
114
115 <refsect1>
116  <title>See Also</title>
117
118  <simplelist type="inline">
119   <member><xref linkend="sql-createopclass"/></member>
120   <member><xref linkend="sql-dropopclass"/></member>
121   <member><xref linkend="sql-alteropfamily"/></member>
122  </simplelist>
123 </refsect1>
124</refentry>
125