1<!--
2doc/src/sgml/ref/alter_tsconfig.sgml
3PostgreSQL documentation
4-->
5
6<refentry id="sql-altertsconfig">
7 <indexterm zone="sql-altertsconfig">
8  <primary>ALTER TEXT SEARCH CONFIGURATION</primary>
9 </indexterm>
10
11 <refmeta>
12  <refentrytitle>ALTER TEXT SEARCH CONFIGURATION</refentrytitle>
13  <manvolnum>7</manvolnum>
14  <refmiscinfo>SQL - Language Statements</refmiscinfo>
15 </refmeta>
16
17 <refnamediv>
18  <refname>ALTER TEXT SEARCH CONFIGURATION</refname>
19  <refpurpose>change the definition of a text search configuration</refpurpose>
20 </refnamediv>
21
22 <refsynopsisdiv>
23<synopsis>
24ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable>
25    ADD MAPPING FOR <replaceable class="parameter">token_type</replaceable> [, ... ] WITH <replaceable class="parameter">dictionary_name</replaceable> [, ... ]
26ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable>
27    ALTER MAPPING FOR <replaceable class="parameter">token_type</replaceable> [, ... ] WITH <replaceable class="parameter">dictionary_name</replaceable> [, ... ]
28ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable>
29    ALTER MAPPING REPLACE <replaceable class="parameter">old_dictionary</replaceable> WITH <replaceable class="parameter">new_dictionary</replaceable>
30ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable>
31    ALTER MAPPING FOR <replaceable class="parameter">token_type</replaceable> [, ... ] REPLACE <replaceable class="parameter">old_dictionary</replaceable> WITH <replaceable class="parameter">new_dictionary</replaceable>
32ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable>
33    DROP MAPPING [ IF EXISTS ] FOR <replaceable class="parameter">token_type</replaceable> [, ... ]
34ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable> RENAME TO <replaceable>new_name</replaceable>
35ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable> OWNER TO { <replaceable>new_owner</replaceable> | CURRENT_USER | SESSION_USER }
36ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable> SET SCHEMA <replaceable>new_schema</replaceable>
37</synopsis>
38 </refsynopsisdiv>
39
40 <refsect1>
41  <title>Description</title>
42
43  <para>
44   <command>ALTER TEXT SEARCH CONFIGURATION</command> changes the definition of
45   a text search configuration.  You can modify
46   its mappings from token types to dictionaries,
47   or change the configuration's name or owner.
48  </para>
49
50  <para>
51   You must be the owner of the configuration to use
52   <command>ALTER TEXT SEARCH CONFIGURATION</command>.
53  </para>
54 </refsect1>
55
56 <refsect1>
57  <title>Parameters</title>
58
59  <variablelist>
60   <varlistentry>
61    <term><replaceable class="parameter">name</replaceable></term>
62    <listitem>
63     <para>
64      The name (optionally schema-qualified) of an existing text search
65      configuration.
66     </para>
67    </listitem>
68   </varlistentry>
69
70   <varlistentry>
71    <term><replaceable class="parameter">token_type</replaceable></term>
72    <listitem>
73     <para>
74      The name of a token type that is emitted by the configuration's
75      parser.
76     </para>
77    </listitem>
78   </varlistentry>
79
80   <varlistentry>
81    <term><replaceable class="parameter">dictionary_name</replaceable></term>
82    <listitem>
83     <para>
84      The name of a text search dictionary to be consulted for the
85      specified token type(s).  If multiple dictionaries are listed,
86      they are consulted in the specified order.
87     </para>
88    </listitem>
89   </varlistentry>
90
91   <varlistentry>
92    <term><replaceable class="parameter">old_dictionary</replaceable></term>
93    <listitem>
94     <para>
95      The name of a text search dictionary to be replaced in the mapping.
96     </para>
97    </listitem>
98   </varlistentry>
99
100   <varlistentry>
101    <term><replaceable class="parameter">new_dictionary</replaceable></term>
102    <listitem>
103     <para>
104      The name of a text search dictionary to be substituted for
105      <replaceable class="parameter">old_dictionary</replaceable>.
106     </para>
107    </listitem>
108   </varlistentry>
109
110   <varlistentry>
111    <term><replaceable class="parameter">new_name</replaceable></term>
112    <listitem>
113     <para>
114      The new name of the text search configuration.
115     </para>
116    </listitem>
117   </varlistentry>
118
119   <varlistentry>
120    <term><replaceable class="parameter">new_owner</replaceable></term>
121    <listitem>
122     <para>
123      The new owner of the text search configuration.
124     </para>
125    </listitem>
126   </varlistentry>
127
128   <varlistentry>
129    <term><replaceable class="parameter">new_schema</replaceable></term>
130    <listitem>
131     <para>
132      The new schema for the text search configuration.
133     </para>
134    </listitem>
135   </varlistentry>
136 </variablelist>
137
138  <para>
139   The <literal>ADD MAPPING FOR</literal> form installs a list of dictionaries to be
140   consulted for the specified token type(s); it is an error if there is
141   already a mapping for any of the token types.
142   The <literal>ALTER MAPPING FOR</literal> form does the same, but first removing
143   any existing mapping for those token types.
144   The <literal>ALTER MAPPING REPLACE</literal> forms substitute <replaceable
145   class="parameter">new_dictionary</replaceable> for <replaceable
146   class="parameter">old_dictionary</replaceable> anywhere the latter appears.
147   This is done for only the specified token types when <literal>FOR</literal>
148   appears, or for all mappings of the configuration when it doesn't.
149   The <literal>DROP MAPPING</literal> form removes all dictionaries for the
150   specified token type(s), causing tokens of those types to be ignored
151   by the text search configuration.  It is an error if there is no mapping
152   for the token types, unless <literal>IF EXISTS</literal> appears.
153  </para>
154
155 </refsect1>
156
157 <refsect1>
158  <title>Examples</title>
159
160  <para>
161   The following example replaces the <literal>english</literal> dictionary
162   with the <literal>swedish</literal> dictionary anywhere that <literal>english</literal>
163   is used within <literal>my_config</literal>.
164  </para>
165
166<programlisting>
167ALTER TEXT SEARCH CONFIGURATION my_config
168  ALTER MAPPING REPLACE english WITH swedish;
169</programlisting>
170 </refsect1>
171
172 <refsect1>
173  <title>Compatibility</title>
174
175  <para>
176   There is no <command>ALTER TEXT SEARCH CONFIGURATION</command> statement in
177   the SQL standard.
178  </para>
179 </refsect1>
180
181 <refsect1>
182  <title>See Also</title>
183
184  <simplelist type="inline">
185   <member><xref linkend="sql-createtsconfig"/></member>
186   <member><xref linkend="sql-droptsconfig"/></member>
187  </simplelist>
188 </refsect1>
189</refentry>
190