The code to unlink dropped relations in FinishPreparedTransaction() was
[PostgreSQL.git] / doc / src / sgml / ref / create_tstemplate.sgml
blob2e7386e61d236f16f15d10766a115af40de7a6ab
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-CREATETSTEMPLATE">
7 <refmeta>
8 <refentrytitle id="sql-createtstemplate-title">CREATE TEXT SEARCH TEMPLATE</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
11 </refmeta>
13 <refnamediv>
14 <refname>CREATE TEXT SEARCH TEMPLATE</refname>
15 <refpurpose>define a new text search template</refpurpose>
16 </refnamediv>
18 <indexterm zone="sql-createtstemplate">
19 <primary>CREATE TEXT SEARCH TEMPLATE</primary>
20 </indexterm>
22 <refsynopsisdiv>
23 <synopsis>
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>
28 </synopsis>
29 </refsynopsisdiv>
31 <refsect1>
32 <title>Description</title>
34 <para>
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.
40 </para>
42 <para>
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.
45 </para>
47 <para>
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
55 privileged operation.
56 </para>
58 <para>
59 Refer to <xref linkend="textsearch"> for further information.
60 </para>
61 </refsect1>
63 <refsect1>
64 <title>Parameters</title>
66 <variablelist>
67 <varlistentry>
68 <term><replaceable class="parameter">name</replaceable></term>
69 <listitem>
70 <para>
71 The name of the text search template to be created. The name can be
72 schema-qualified.
73 </para>
74 </listitem>
75 </varlistentry>
77 <varlistentry>
78 <term><replaceable class="parameter">init_function</replaceable></term>
79 <listitem>
80 <para>
81 The name of the init function for the template.
82 </para>
83 </listitem>
84 </varlistentry>
86 <varlistentry>
87 <term><replaceable class="parameter">lexize_function</replaceable></term>
88 <listitem>
89 <para>
90 The name of the lexize function for the template.
91 </para>
92 </listitem>
93 </varlistentry>
94 </variablelist>
96 <para>
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
100 is optional.
101 </para>
103 <para>
104 The arguments can appear in any order, not only the one shown above.
105 </para>
106 </refsect1>
108 <refsect1>
109 <title>Compatibility</title>
111 <para>
112 There is no
113 <command>CREATE TEXT SEARCH TEMPLATE</command> statement in the SQL
114 standard.
115 </para>
116 </refsect1>
118 <refsect1>
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>
124 </simplelist>
125 </refsect1>
126 </refentry>