]> begriffs open source - ai-pg/blob - full-docs/src/sgml/html/sql-altertsconfig.html
PG 18 docs from https://ftp.postgresql.org/pub/source/v18.0/postgresql-18.0-docs...
[ai-pg] / full-docs / src / sgml / html / sql-altertsconfig.html
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ALTER TEXT SEARCH CONFIGURATION</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="sql-altertablespace.html" title="ALTER TABLESPACE" /><link rel="next" href="sql-altertsdictionary.html" title="ALTER TEXT SEARCH DICTIONARY" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">ALTER TEXT SEARCH CONFIGURATION</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="sql-altertablespace.html" title="ALTER TABLESPACE">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="sql-commands.html" title="SQL Commands">Up</a></td><th width="60%" align="center">SQL Commands</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="sql-altertsdictionary.html" title="ALTER TEXT SEARCH DICTIONARY">Next</a></td></tr></table><hr /></div><div class="refentry" id="SQL-ALTERTSCONFIG"><div class="titlepage"></div><a id="id-1.9.3.37.1" class="indexterm"></a><div class="refnamediv"><h2><span class="refentrytitle">ALTER TEXT SEARCH CONFIGURATION</span></h2><p>ALTER TEXT SEARCH CONFIGURATION — change the definition of a text search configuration</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
3 ALTER TEXT SEARCH CONFIGURATION <em class="replaceable"><code>name</code></em>
4     ADD MAPPING FOR <em class="replaceable"><code>token_type</code></em> [, ... ] WITH <em class="replaceable"><code>dictionary_name</code></em> [, ... ]
5 ALTER TEXT SEARCH CONFIGURATION <em class="replaceable"><code>name</code></em>
6     ALTER MAPPING FOR <em class="replaceable"><code>token_type</code></em> [, ... ] WITH <em class="replaceable"><code>dictionary_name</code></em> [, ... ]
7 ALTER TEXT SEARCH CONFIGURATION <em class="replaceable"><code>name</code></em>
8     ALTER MAPPING REPLACE <em class="replaceable"><code>old_dictionary</code></em> WITH <em class="replaceable"><code>new_dictionary</code></em>
9 ALTER TEXT SEARCH CONFIGURATION <em class="replaceable"><code>name</code></em>
10     ALTER MAPPING FOR <em class="replaceable"><code>token_type</code></em> [, ... ] REPLACE <em class="replaceable"><code>old_dictionary</code></em> WITH <em class="replaceable"><code>new_dictionary</code></em>
11 ALTER TEXT SEARCH CONFIGURATION <em class="replaceable"><code>name</code></em>
12     DROP MAPPING [ IF EXISTS ] FOR <em class="replaceable"><code>token_type</code></em> [, ... ]
13 ALTER TEXT SEARCH CONFIGURATION <em class="replaceable"><code>name</code></em> RENAME TO <em class="replaceable"><code>new_name</code></em>
14 ALTER TEXT SEARCH CONFIGURATION <em class="replaceable"><code>name</code></em> OWNER TO { <em class="replaceable"><code>new_owner</code></em> | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
15 ALTER TEXT SEARCH CONFIGURATION <em class="replaceable"><code>name</code></em> SET SCHEMA <em class="replaceable"><code>new_schema</code></em>
16 </pre></div><div class="refsect1" id="id-1.9.3.37.5"><h2>Description</h2><p>
17    <code class="command">ALTER TEXT SEARCH CONFIGURATION</code> changes the definition of
18    a text search configuration.  You can modify
19    its mappings from token types to dictionaries,
20    or change the configuration's name or owner.
21   </p><p>
22    You must be the owner of the configuration to use
23    <code class="command">ALTER TEXT SEARCH CONFIGURATION</code>.
24   </p></div><div class="refsect1" id="id-1.9.3.37.6"><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>name</code></em></span></dt><dd><p>
25       The name (optionally schema-qualified) of an existing text search
26       configuration.
27      </p></dd><dt><span class="term"><em class="replaceable"><code>token_type</code></em></span></dt><dd><p>
28       The name of a token type that is emitted by the configuration's
29       parser.
30      </p></dd><dt><span class="term"><em class="replaceable"><code>dictionary_name</code></em></span></dt><dd><p>
31       The name of a text search dictionary to be consulted for the
32       specified token type(s).  If multiple dictionaries are listed,
33       they are consulted in the specified order.
34      </p></dd><dt><span class="term"><em class="replaceable"><code>old_dictionary</code></em></span></dt><dd><p>
35       The name of a text search dictionary to be replaced in the mapping.
36      </p></dd><dt><span class="term"><em class="replaceable"><code>new_dictionary</code></em></span></dt><dd><p>
37       The name of a text search dictionary to be substituted for
38       <em class="replaceable"><code>old_dictionary</code></em>.
39      </p></dd><dt><span class="term"><em class="replaceable"><code>new_name</code></em></span></dt><dd><p>
40       The new name of the text search configuration.
41      </p></dd><dt><span class="term"><em class="replaceable"><code>new_owner</code></em></span></dt><dd><p>
42       The new owner of the text search configuration.
43      </p></dd><dt><span class="term"><em class="replaceable"><code>new_schema</code></em></span></dt><dd><p>
44       The new schema for the text search configuration.
45      </p></dd></dl></div><p>
46    The <code class="literal">ADD MAPPING FOR</code> form installs a list of dictionaries to be
47    consulted for the specified token type(s); it is an error if there is
48    already a mapping for any of the token types.
49    The <code class="literal">ALTER MAPPING FOR</code> form does the same, but first removing
50    any existing mapping for those token types.
51    The <code class="literal">ALTER MAPPING REPLACE</code> forms substitute <em class="replaceable"><code>new_dictionary</code></em> for <em class="replaceable"><code>old_dictionary</code></em> anywhere the latter appears.
52    This is done for only the specified token types when <code class="literal">FOR</code>
53    appears, or for all mappings of the configuration when it doesn't.
54    The <code class="literal">DROP MAPPING</code> form removes all dictionaries for the
55    specified token type(s), causing tokens of those types to be ignored
56    by the text search configuration.  It is an error if there is no mapping
57    for the token types, unless <code class="literal">IF EXISTS</code> appears.
58   </p></div><div class="refsect1" id="id-1.9.3.37.7"><h2>Examples</h2><p>
59    The following example replaces the <code class="literal">english</code> dictionary
60    with the <code class="literal">swedish</code> dictionary anywhere that <code class="literal">english</code>
61    is used within <code class="literal">my_config</code>.
62   </p><pre class="programlisting">
63 ALTER TEXT SEARCH CONFIGURATION my_config
64   ALTER MAPPING REPLACE english WITH swedish;
65 </pre></div><div class="refsect1" id="id-1.9.3.37.8"><h2>Compatibility</h2><p>
66    There is no <code class="command">ALTER TEXT SEARCH CONFIGURATION</code> statement in
67    the SQL standard.
68   </p></div><div class="refsect1" id="id-1.9.3.37.9"><h2>See Also</h2><span class="simplelist"><a class="xref" href="sql-createtsconfig.html" title="CREATE TEXT SEARCH CONFIGURATION"><span class="refentrytitle">CREATE TEXT SEARCH CONFIGURATION</span></a>, <a class="xref" href="sql-droptsconfig.html" title="DROP TEXT SEARCH CONFIGURATION"><span class="refentrytitle">DROP TEXT SEARCH CONFIGURATION</span></a></span></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="sql-altertablespace.html" title="ALTER TABLESPACE">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="sql-commands.html" title="SQL Commands">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="sql-altertsdictionary.html" title="ALTER TEXT SEARCH DICTIONARY">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ALTER TABLESPACE </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="40%" align="right" valign="top"> ALTER TEXT SEARCH DICTIONARY</td></tr></table></div></body></html>