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