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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
<!--
doc/src/sgml/ref/alter_tsconfig.sgml
PostgreSQL documentation
-->
<refentry id="sql-altertsconfig">
<indexterm zone="sql-altertsconfig">
<primary>ALTER TEXT SEARCH CONFIGURATION</primary>
</indexterm>
<refmeta>
<refentrytitle>ALTER TEXT SEARCH CONFIGURATION</refentrytitle>
<manvolnum>7</manvolnum>
<refmiscinfo>SQL - Language Statements</refmiscinfo>
</refmeta>
<refnamediv>
<refname>ALTER TEXT SEARCH CONFIGURATION</refname>
<refpurpose>change the definition of a text search configuration</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable>
ADD MAPPING FOR <replaceable class="parameter">token_type</replaceable> [, ... ] WITH <replaceable class="parameter">dictionary_name</replaceable> [, ... ]
ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable>
ALTER MAPPING FOR <replaceable class="parameter">token_type</replaceable> [, ... ] WITH <replaceable class="parameter">dictionary_name</replaceable> [, ... ]
ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable>
ALTER MAPPING REPLACE <replaceable class="parameter">old_dictionary</replaceable> WITH <replaceable class="parameter">new_dictionary</replaceable>
ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable>
ALTER MAPPING FOR <replaceable class="parameter">token_type</replaceable> [, ... ] REPLACE <replaceable class="parameter">old_dictionary</replaceable> WITH <replaceable class="parameter">new_dictionary</replaceable>
ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable>
DROP MAPPING [ IF EXISTS ] FOR <replaceable class="parameter">token_type</replaceable> [, ... ]
ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable> RENAME TO <replaceable>new_name</replaceable>
ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable> OWNER TO { <replaceable>new_owner</replaceable> | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable> SET SCHEMA <replaceable>new_schema</replaceable>
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
<command>ALTER TEXT SEARCH CONFIGURATION</command> changes the definition of
a text search configuration. You can modify
its mappings from token types to dictionaries,
or change the configuration's name or owner.
</para>
<para>
You must be the owner of the configuration to use
<command>ALTER TEXT SEARCH CONFIGURATION</command>.
</para>
</refsect1>
<refsect1>
<title>Parameters</title>
<variablelist>
<varlistentry>
<term><replaceable class="parameter">name</replaceable></term>
<listitem>
<para>
The name (optionally schema-qualified) of an existing text search
configuration.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">token_type</replaceable></term>
<listitem>
<para>
The name of a token type that is emitted by the configuration's
parser.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">dictionary_name</replaceable></term>
<listitem>
<para>
The name of a text search dictionary to be consulted for the
specified token type(s). If multiple dictionaries are listed,
they are consulted in the specified order.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">old_dictionary</replaceable></term>
<listitem>
<para>
The name of a text search dictionary to be replaced in the mapping.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">new_dictionary</replaceable></term>
<listitem>
<para>
The name of a text search dictionary to be substituted for
<replaceable class="parameter">old_dictionary</replaceable>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">new_name</replaceable></term>
<listitem>
<para>
The new name of the text search configuration.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">new_owner</replaceable></term>
<listitem>
<para>
The new owner of the text search configuration.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">new_schema</replaceable></term>
<listitem>
<para>
The new schema for the text search configuration.
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
The <literal>ADD MAPPING FOR</literal> form installs a list of dictionaries to be
consulted for the specified token type(s); it is an error if there is
already a mapping for any of the token types.
The <literal>ALTER MAPPING FOR</literal> form does the same, but first removing
any existing mapping for those token types.
The <literal>ALTER MAPPING REPLACE</literal> forms substitute <replaceable
class="parameter">new_dictionary</replaceable> for <replaceable
class="parameter">old_dictionary</replaceable> anywhere the latter appears.
This is done for only the specified token types when <literal>FOR</literal>
appears, or for all mappings of the configuration when it doesn't.
The <literal>DROP MAPPING</literal> form removes all dictionaries for the
specified token type(s), causing tokens of those types to be ignored
by the text search configuration. It is an error if there is no mapping
for the token types, unless <literal>IF EXISTS</literal> appears.
</para>
</refsect1>
<refsect1>
<title>Examples</title>
<para>
The following example replaces the <literal>english</literal> dictionary
with the <literal>swedish</literal> dictionary anywhere that <literal>english</literal>
is used within <literal>my_config</literal>.
</para>
<programlisting>
ALTER TEXT SEARCH CONFIGURATION my_config
ALTER MAPPING REPLACE english WITH swedish;
</programlisting>
</refsect1>
<refsect1>
<title>Compatibility</title>
<para>
There is no <command>ALTER TEXT SEARCH CONFIGURATION</command> statement in
the SQL standard.
</para>
</refsect1>
<refsect1>
<title>See Also</title>
<simplelist type="inline">
<member><xref linkend="sql-createtsconfig"/></member>
<member><xref linkend="sql-droptsconfig"/></member>
</simplelist>
</refsect1>
</refentry>
|