summaryrefslogtreecommitdiffstats
path: root/doc/src/sgml/ref/create_opfamily.sgml
blob: ba612c2f2b035ec1d7a1a4547ca7d7c871b181f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!--
doc/src/sgml/ref/create_opfamily.sgml
PostgreSQL documentation
-->

<refentry id="sql-createopfamily">
 <indexterm zone="sql-createopfamily">
  <primary>CREATE OPERATOR FAMILY</primary>
 </indexterm>

 <refmeta>
  <refentrytitle>CREATE OPERATOR FAMILY</refentrytitle>
  <manvolnum>7</manvolnum>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>CREATE OPERATOR FAMILY</refname>
  <refpurpose>define a new operator family</refpurpose>
 </refnamediv>

 <refsynopsisdiv>
<synopsis>
CREATE OPERATOR FAMILY <replaceable class="parameter">name</replaceable> USING <replaceable class="parameter">index_method</replaceable>
</synopsis>
 </refsynopsisdiv>

 <refsect1>
  <title>Description</title>

  <para>
   <command>CREATE OPERATOR FAMILY</command> creates a new operator family.
   An operator family defines a collection of related operator classes,
   and perhaps some additional operators and support functions that are
   compatible with these operator classes but not essential for the
   functioning of any individual index.  (Operators and functions that
   are essential to indexes should be grouped within the relevant operator
   class, rather than being <quote>loose</quote> in the operator family.
   Typically, single-data-type operators are bound to operator classes,
   while cross-data-type operators can be loose in an operator family
   containing operator classes for both data types.)
  </para>

  <para>
   The new operator family is initially empty.  It should be populated
   by issuing subsequent <command>CREATE OPERATOR CLASS</command> commands
   to add contained operator classes, and optionally
   <command>ALTER OPERATOR FAMILY</command> commands to add <quote>loose</quote>
   operators and their corresponding support functions.
  </para>

  <para>
   If a schema name is given then the operator family is created in the
   specified schema.  Otherwise it is created in the current schema.
   Two operator families in the same schema can have the same name only if they
   are for different index methods.
  </para>

  <para>
   The user who defines an operator family becomes its owner.  Presently,
   the creating user must be a superuser.  (This restriction is made because
   an erroneous operator family definition could confuse or even crash the
   server.)
  </para>

  <para>
   Refer to <xref linkend="xindex"/> for further information.
  </para>
 </refsect1>

 <refsect1>
  <title>Parameters</title>

  <variablelist>
   <varlistentry>
    <term><replaceable class="parameter">name</replaceable></term>
    <listitem>
     <para>
      The name of the operator family to be created.  The name can be
      schema-qualified.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">index_method</replaceable></term>
    <listitem>
     <para>
      The name of the index method this operator family is for.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1>
  <title>Compatibility</title>

  <para>
   <command>CREATE OPERATOR FAMILY</command> is a
   <productname>PostgreSQL</productname> extension.  There is no
   <command>CREATE OPERATOR FAMILY</command> statement in the SQL
   standard.
  </para>
 </refsect1>

 <refsect1>
  <title>See Also</title>

  <simplelist type="inline">
   <member><xref linkend="sql-alteropfamily"/></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>