<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/alter_opfamily.sgml,v 1.6 2009/09/19 10:23:26 petere Exp $
+doc/src/sgml/ref/alter_opfamily.sgml
PostgreSQL documentation
-->
<refentry id="SQL-ALTEROPFAMILY">
<refmeta>
- <refentrytitle id="SQL-ALTEROPFAMILY-TITLE">ALTER OPERATOR FAMILY</refentrytitle>
+ <refentrytitle>ALTER OPERATOR FAMILY</refentrytitle>
<manvolnum>7</manvolnum>
<refmiscinfo>SQL - Language Statements</refmiscinfo>
</refmeta>
<refnamediv>
<refname>ALTER OPERATOR FAMILY</refname>
<refpurpose>change the definition of an operator family</refpurpose>
- </refnamediv>
-
+ </refnamediv>
+
<indexterm zone="sql-alteropfamily">
<primary>ALTER OPERATOR FAMILY</primary>
</indexterm>
<refsynopsisdiv>
<synopsis>
ALTER OPERATOR FAMILY <replaceable>name</replaceable> USING <replaceable class="parameter">index_method</replaceable> ADD
- { OPERATOR <replaceable class="parameter">strategy_number</replaceable> <replaceable class="parameter">operator_name</replaceable> ( <replaceable class="parameter">op_type</replaceable>, <replaceable class="parameter">op_type</replaceable> )
+ { OPERATOR <replaceable class="parameter">strategy_number</replaceable> <replaceable class="parameter">operator_name</replaceable> ( <replaceable class="parameter">op_type</replaceable>, <replaceable class="parameter">op_type</replaceable> ) [ FOR SEARCH | FOR ORDER BY <replaceable class="parameter">sort_family_name</replaceable> ]
| FUNCTION <replaceable class="parameter">support_number</replaceable> [ ( <replaceable class="parameter">op_type</replaceable> [ , <replaceable class="parameter">op_type</replaceable> ] ) ] <replaceable class="parameter">function_name</replaceable> ( <replaceable class="parameter">argument_type</replaceable> [, ...] )
} [, ... ]
ALTER OPERATOR FAMILY <replaceable>name</replaceable> USING <replaceable class="parameter">index_method</replaceable> DROP
} [, ... ]
ALTER OPERATOR FAMILY <replaceable>name</replaceable> USING <replaceable class="parameter">index_method</replaceable> RENAME TO <replaceable>new_name</replaceable>
ALTER OPERATOR FAMILY <replaceable>name</replaceable> USING <replaceable class="parameter">index_method</replaceable> OWNER TO <replaceable>new_owner</replaceable>
+ALTER OPERATOR FAMILY <replaceable>name</replaceable> USING <replaceable class="parameter">index_method</replaceable> SET SCHEMA <replaceable>new_schema</replaceable>
</synopsis>
</refsynopsisdiv>
-
+
<refsect1>
<title>Description</title>
are compatible with the family's semantics, but are not required for
correct functioning of any specific index. (Operators and functions
that are so required should be declared as part of an operator class,
- instead; see <xref linkend="sql-createopclass"
- endterm="sql-createopclass-title">.)
+ instead; see <xref linkend="sql-createopclass">.)
<productname>PostgreSQL</productname> will allow loose members of a
family to be dropped from the family at any time, but members of an
operator class cannot be dropped without dropping the whole class and
Refer to <xref linkend="xindex"> for further information.
</para>
</refsect1>
-
+
<refsect1>
<title>Parameters</title>
<para>
In an <literal>ADD FUNCTION</> clause, the operand data type(s) the
function is intended to support, if different from
- the input data type(s) of the function. For B-tree and hash indexes
- it is not necessary to specify <replaceable
+ the input data type(s) of the function. For B-tree comparison functions
+ and hash functions it is not necessary to specify <replaceable
class="parameter">op_type</replaceable> since the function's input
- data type(s) are always the correct ones to use. For GIN and GiST
- indexes it is necessary to specify the input data type the function
+ data type(s) are always the correct ones to use. For B-tree sort
+ support functions and all functions in GiST and GIN operator classes,
+ it is necessary to specify the operand data type(s) the function
is to be used with.
</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><replaceable class="parameter">sort_family_name</replaceable></term>
+ <listitem>
+ <para>
+ The name (optionally schema-qualified) of an existing <literal>btree</literal> operator
+ family that describes the sort ordering associated with an ordering
+ operator.
+ </para>
+
+ <para>
+ If neither <literal>FOR SEARCH</> nor <literal>FOR ORDER BY</> is
+ specified, <literal>FOR SEARCH</> is the default.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><replaceable class="parameter">support_number</replaceable></term>
<listitem>
</para>
</listitem>
</varlistentry>
+
+ <varlistentry>
+ <term><replaceable class="parameter">new_schema</replaceable></term>
+ <listitem>
+ <para>
+ The new schema for the operator family.
+ </para>
+ </listitem>
+ </varlistentry>
</variablelist>
<para>
</para>
</refsect1>
-
+
<refsect1>
<title>Notes</title>
Before <productname>PostgreSQL</productname> 8.4, the <literal>OPERATOR</>
clause could include a <literal>RECHECK</> option. This is no longer
supported because whether an index operator is <quote>lossy</> is now
- determined on-the-fly at runtime. This allows efficient handling of
+ determined on-the-fly at run time. This allows efficient handling of
cases where an operator might or might not be lossy.
</para>
</refsect1>
-
+
<refsect1>
<title>Examples</title>
OPERATOR 4 >= (int2, int4) ,
OPERATOR 5 > (int2, int4) ,
FUNCTION 1 btint24cmp(int2, int4) ;
-</programlisting>
+</programlisting>
<para>
To remove these entries again:
OPERATOR 4 (int2, int4) ,
OPERATOR 5 (int2, int4) ,
FUNCTION 1 (int2, int4) ;
-</programlisting>
+</programlisting>
</refsect1>
<refsect1>
<title>See Also</title>
<simplelist type="inline">
- <member><xref linkend="sql-createopfamily" endterm="sql-createopfamily-title"></member>
- <member><xref linkend="sql-dropopfamily" endterm="sql-dropopfamily-title"></member>
- <member><xref linkend="sql-createopclass" endterm="sql-createopclass-title"></member>
- <member><xref linkend="sql-alteropclass" endterm="sql-alteropclass-title"></member>
- <member><xref linkend="sql-dropopclass" endterm="sql-dropopclass-title"></member>
+ <member><xref linkend="sql-createopfamily"></member>
+ <member><xref linkend="sql-dropopfamily"></member>
+ <member><xref linkend="sql-createopclass"></member>
+ <member><xref linkend="sql-alteropclass"></member>
+ <member><xref linkend="sql-dropopclass"></member>
</simplelist>
</refsect1>
</refentry>