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