2007-08-21 23:08:47 +02:00
<!--
2010-09-20 22:08:53 +02:00
doc/src/sgml/ref/alter_tsconfig.sgml
2007-08-21 23:08:47 +02:00
PostgreSQL documentation
-->
2017-10-20 03:16:39 +02:00
<refentry id="sql-altertsconfig">
2014-02-24 03:25:35 +01:00
<indexterm zone="sql-altertsconfig">
<primary>ALTER TEXT SEARCH CONFIGURATION</primary>
</indexterm>
2007-08-21 23:08:47 +02:00
<refmeta>
2010-04-03 09:23:02 +02:00
<refentrytitle>ALTER TEXT SEARCH CONFIGURATION</refentrytitle>
2008-11-14 11:22:48 +01:00
<manvolnum>7</manvolnum>
2007-08-21 23:08:47 +02:00
<refmiscinfo>SQL - Language Statements</refmiscinfo>
</refmeta>
<refnamediv>
<refname>ALTER TEXT SEARCH CONFIGURATION</refname>
<refpurpose>change the definition of a text search configuration</refpurpose>
2010-11-23 21:27:50 +01:00
</refnamediv>
2007-08-21 23:08:47 +02:00
<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> [, ... ]
2009-09-19 12:23:27 +02:00
ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable> RENAME TO <replaceable>new_name</replaceable>
2020-09-17 11:39:28 +02:00
ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable> OWNER TO { <replaceable>new_owner</replaceable> | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
2010-11-26 23:27:23 +01:00
ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable> SET SCHEMA <replaceable>new_schema</replaceable>
2007-08-21 23:08:47 +02:00
</synopsis>
</refsynopsisdiv>
2010-11-23 21:27:50 +01:00
2007-08-21 23:08:47 +02:00
<refsect1>
<title>Description</title>
<para>
<command>ALTER TEXT SEARCH CONFIGURATION</command> changes the definition of
2007-08-22 07:13:50 +02:00
a text search configuration. You can modify
its mappings from token types to dictionaries,
2007-08-21 23:08:47 +02:00
or change the configuration's name or owner.
</para>
<para>
You must be the owner of the configuration to use
2017-10-09 03:44:17 +02:00
<command>ALTER TEXT SEARCH CONFIGURATION</command>.
2007-08-21 23:08:47 +02:00
</para>
</refsect1>
2010-11-23 21:27:50 +01:00
2007-08-21 23:08:47 +02:00
<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>
2007-08-22 08:26:32 +02:00
<term><replaceable class="parameter">new_dictionary</replaceable></term>
2007-08-21 23:08:47 +02:00
<listitem>
<para>
The name of a text search dictionary to be substituted for
<replaceable class="parameter">old_dictionary</replaceable>.
</para>
</listitem>
</varlistentry>
<varlistentry>
2009-09-19 12:23:27 +02:00
<term><replaceable class="parameter">new_name</replaceable></term>
2007-08-21 23:08:47 +02:00
<listitem>
<para>
The new name of the text search configuration.
</para>
</listitem>
</varlistentry>
<varlistentry>
2009-09-19 12:23:27 +02:00
<term><replaceable class="parameter">new_owner</replaceable></term>
2007-08-21 23:08:47 +02:00
<listitem>
<para>
The new owner of the text search configuration.
</para>
</listitem>
</varlistentry>
2010-11-26 23:27:23 +01:00
<varlistentry>
<term><replaceable class="parameter">new_schema</replaceable></term>
<listitem>
<para>
The new schema for the text search configuration.
</para>
</listitem>
</varlistentry>
2007-08-21 23:08:47 +02:00
</variablelist>
<para>
2017-10-09 03:44:17 +02:00
The <literal>ADD MAPPING FOR</literal> form installs a list of dictionaries to be
2007-08-21 23:08:47 +02:00
consulted for the specified token type(s); it is an error if there is
already a mapping for any of the token types.
2017-10-09 03:44:17 +02:00
The <literal>ALTER MAPPING FOR</literal> form does the same, but first removing
2007-08-21 23:08:47 +02:00
any existing mapping for those token types.
2017-10-09 03:44:17 +02:00
The <literal>ALTER MAPPING REPLACE</literal> forms substitute <replaceable
2007-08-21 23:08:47 +02:00
class="parameter">new_dictionary</replaceable> for <replaceable
class="parameter">old_dictionary</replaceable> anywhere the latter appears.
2017-10-09 03:44:17 +02:00
This is done for only the specified token types when <literal>FOR</literal>
2007-08-21 23:08:47 +02:00
appears, or for all mappings of the configuration when it doesn't.
2017-10-09 03:44:17 +02:00
The <literal>DROP MAPPING</literal> form removes all dictionaries for the
2007-08-21 23:08:47 +02:00
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
2017-10-09 03:44:17 +02:00
for the token types, unless <literal>IF EXISTS</literal> appears.
2007-08-21 23:08:47 +02:00
</para>
</refsect1>
<refsect1>
<title>Examples</title>
<para>
2017-10-09 03:44:17 +02:00
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>.
2007-08-21 23:08:47 +02:00
</para>
<programlisting>
ALTER TEXT SEARCH CONFIGURATION my_config
ALTER MAPPING REPLACE english WITH swedish;
2010-11-23 21:27:50 +01:00
</programlisting>
2007-08-21 23:08:47 +02:00
</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">
2017-11-23 15:39:47 +01:00
<member><xref linkend="sql-createtsconfig"/></member>
<member><xref linkend="sql-droptsconfig"/></member>
2007-08-21 23:08:47 +02:00
</simplelist>
</refsect1>
</refentry>