3 PostgreSQL documentation
6 <refentry id=
"SQL-CREATEOPFAMILY">
8 <refentrytitle id=
"sql-createopfamily-title">CREATE OPERATOR FAMILY
</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements
</refmiscinfo>
14 <refname>CREATE OPERATOR FAMILY
</refname>
15 <refpurpose>define a new operator family
</refpurpose>
18 <indexterm zone=
"sql-createopfamily">
19 <primary>CREATE OPERATOR FAMILY
</primary>
24 CREATE OPERATOR FAMILY
<replaceable class=
"parameter">name
</replaceable> USING
<replaceable class=
"parameter">index_method
</replaceable>
29 <title>Description
</title>
32 <command>CREATE OPERATOR FAMILY
</command> creates a new operator family.
33 An operator family defines a collection of related operator classes,
34 and perhaps some additional operators and support functions that are
35 compatible with these operator classes but not essential for the
36 functioning of any individual index. (Operators and functions that
37 are essential to indexes should be grouped within the relevant operator
38 class, rather than being
<quote>loose<
/> in the operator family.
39 Typically, single-data-type operators are bound to operator classes,
40 while cross-data-type operators can be loose in an operator family
41 containing operator classes for both data types.)
45 The new operator family is initially empty. It should be populated
46 by issuing subsequent
<command>CREATE OPERATOR CLASS
</command> commands
47 to add contained operator classes, and optionally
48 <command>ALTER OPERATOR FAMILY
</command> commands to add
<quote>loose<
/>
49 operators and their corresponding support functions.
53 If a schema name is given then the operator family is created in the
54 specified schema. Otherwise it is created in the current schema.
55 Two operator families in the same schema can have the same name only if they
56 are for different index methods.
60 The user who defines an operator family becomes its owner. Presently,
61 the creating user must be a superuser. (This restriction is made because
62 an erroneous operator family definition could confuse or even crash the
67 Refer to
<xref linkend=
"xindex"> for further information.
72 <title>Parameters
</title>
76 <term><replaceable class=
"parameter">name
</replaceable></term>
79 The name of the operator family to be created. The name can be
86 <term><replaceable class=
"parameter">index_method
</replaceable></term>
89 The name of the index method this operator family is for.
97 <title>Compatibility
</title>
100 <command>CREATE OPERATOR FAMILY
</command> is a
101 <productname>PostgreSQL
</productname> extension. There is no
102 <command>CREATE OPERATOR FAMILY
</command> statement in the SQL
108 <title>See Also
</title>
110 <simplelist type=
"inline">
111 <member><xref linkend=
"sql-alteropfamily" endterm=
"sql-alteropfamily-title"></member>
112 <member><xref linkend=
"sql-dropopfamily" endterm=
"sql-dropopfamily-title"></member>
113 <member><xref linkend=
"sql-createopclass" endterm=
"sql-createopclass-title"></member>
114 <member><xref linkend=
"sql-alteropclass" endterm=
"sql-alteropclass-title"></member>
115 <member><xref linkend=
"sql-dropopclass" endterm=
"sql-dropopclass-title"></member>