3 PostgreSQL documentation
6 <refentry id=
"SQL-CREATETSTEMPLATE">
8 <refentrytitle id=
"sql-createtstemplate-title">CREATE TEXT SEARCH TEMPLATE
</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements
</refmiscinfo>
14 <refname>CREATE TEXT SEARCH TEMPLATE
</refname>
15 <refpurpose>define a new text search template
</refpurpose>
18 <indexterm zone=
"sql-createtstemplate">
19 <primary>CREATE TEXT SEARCH TEMPLATE
</primary>
24 CREATE TEXT SEARCH TEMPLATE
<replaceable class=
"parameter">name
</replaceable> (
25 [ INIT =
<replaceable class=
"parameter">init_function
</replaceable> , ]
26 LEXIZE =
<replaceable class=
"parameter">lexize_function
</replaceable>
32 <title>Description
</title>
35 <command>CREATE TEXT SEARCH TEMPLATE
</command> creates a new text search
36 template. Text search templates define the functions that implement
37 text search dictionaries. A template is not useful by itself, but must
38 be instantiated as a dictionary to be used. The dictionary typically
39 specifies parameters to be given to the template functions.
43 If a schema name is given then the text search template is created in the
44 specified schema. Otherwise it is created in the current schema.
48 You must be a superuser to use
<command>CREATE TEXT SEARCH
49 TEMPLATE
</command>. This restriction is made because an erroneous text
50 search template definition could confuse or even crash the server.
51 The reason for separating templates from dictionaries is that a template
52 encapsulates the
<quote>unsafe<
/> aspects of defining a dictionary.
53 The parameters that can be set when defining a dictionary are safe for
54 unprivileged users to set, and so creating a dictionary need not be a
59 Refer to
<xref linkend=
"textsearch"> for further information.
64 <title>Parameters
</title>
68 <term><replaceable class=
"parameter">name
</replaceable></term>
71 The name of the text search template to be created. The name can be
78 <term><replaceable class=
"parameter">init_function
</replaceable></term>
81 The name of the init function for the template.
87 <term><replaceable class=
"parameter">lexize_function
</replaceable></term>
90 The name of the lexize function for the template.
97 The function names can be schema-qualified if necessary. Argument types
98 are not given, since the argument list for each type of function is
99 predetermined. The lexize function is required, but the init function
104 The arguments can appear in any order, not only the one shown above.
109 <title>Compatibility
</title>
113 <command>CREATE TEXT SEARCH TEMPLATE
</command> statement in the SQL
119 <title>See Also
</title>
121 <simplelist type=
"inline">
122 <member><xref linkend=
"sql-altertstemplate" endterm=
"sql-altertstemplate-title"></member>
123 <member><xref linkend=
"sql-droptstemplate" endterm=
"sql-droptstemplate-title"></member>