|
| 1 | +<!-- |
| 2 | +$PostgreSQL: pgsql/doc/src/sgml/ref/alter_tsconfig.sgml,v 1.1 2007/08/21 21:08:47 tgl Exp $ |
| 3 | +PostgreSQL documentation |
| 4 | +--> |
| 5 | + |
| 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> |
| 11 | + |
| 12 | + <refnamediv> |
| 13 | + <refname>ALTER TEXT SEARCH CONFIGURATION</refname> |
| 14 | + <refpurpose>change the definition of a text search configuration</refpurpose> |
| 15 | + </refnamediv> |
| 16 | + |
| 17 | + <indexterm zone="sql-altertsconfig"> |
| 18 | + <primary>ALTER TEXT SEARCH CONFIGURATION</primary> |
| 19 | + </indexterm> |
| 20 | + |
| 21 | + <refsynopsisdiv> |
| 22 | +<synopsis> |
| 23 | +ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable> ( |
| 24 | + PARSER = <replaceable class="parameter">parser_name</replaceable> |
| 25 | +) |
| 26 | +ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable> |
| 27 | + ADD 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 FOR <replaceable class="parameter">token_type</replaceable> [, ... ] WITH <replaceable class="parameter">dictionary_name</replaceable> [, ... ] |
| 30 | +ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable> |
| 31 | + ALTER MAPPING REPLACE <replaceable class="parameter">old_dictionary</replaceable> WITH <replaceable class="parameter">new_dictionary</replaceable> |
| 32 | +ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable> |
| 33 | + ALTER MAPPING FOR <replaceable class="parameter">token_type</replaceable> [, ... ] REPLACE <replaceable class="parameter">old_dictionary</replaceable> WITH <replaceable class="parameter">new_dictionary</replaceable> |
| 34 | +ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable> |
| 35 | + DROP MAPPING [ IF EXISTS ] FOR <replaceable class="parameter">token_type</replaceable> [, ... ] |
| 36 | +ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable> RENAME TO <replaceable>newname</replaceable> |
| 37 | +ALTER TEXT SEARCH CONFIGURATION <replaceable>name</replaceable> OWNER TO <replaceable>newowner</replaceable> |
| 38 | +</synopsis> |
| 39 | + </refsynopsisdiv> |
| 40 | + |
| 41 | + <refsect1> |
| 42 | + <title>Description</title> |
| 43 | + |
| 44 | + <para> |
| 45 | + <command>ALTER TEXT SEARCH CONFIGURATION</command> changes the definition of |
| 46 | + a text search configuration. You can change which parser it uses, modify |
| 47 | + its mapping from token types to dictionaries, |
| 48 | + or change the configuration's name or owner. |
| 49 | + </para> |
| 50 | + |
| 51 | + <para> |
| 52 | + You must be the owner of the configuration to use |
| 53 | + <command>ALTER TEXT SEARCH CONFIGURATION</>. |
| 54 | + </para> |
| 55 | + </refsect1> |
| 56 | + |
| 57 | + <refsect1> |
| 58 | + <title>Parameters</title> |
| 59 | + |
| 60 | + <variablelist> |
| 61 | + <varlistentry> |
| 62 | + <term><replaceable class="parameter">name</replaceable></term> |
| 63 | + <listitem> |
| 64 | + <para> |
| 65 | + The name (optionally schema-qualified) of an existing text search |
| 66 | + configuration. |
| 67 | + </para> |
| 68 | + </listitem> |
| 69 | + </varlistentry> |
| 70 | + |
| 71 | + <varlistentry> |
| 72 | + <term><replaceable class="parameter">parser_name</replaceable></term> |
| 73 | + <listitem> |
| 74 | + <para> |
| 75 | + The name of a new text search parser to use for this configuration. |
| 76 | + </para> |
| 77 | + </listitem> |
| 78 | + </varlistentry> |
| 79 | + |
| 80 | + <varlistentry> |
| 81 | + <term><replaceable class="parameter">token_type</replaceable></term> |
| 82 | + <listitem> |
| 83 | + <para> |
| 84 | + The name of a token type that is emitted by the configuration's |
| 85 | + parser. |
| 86 | + </para> |
| 87 | + </listitem> |
| 88 | + </varlistentry> |
| 89 | + |
| 90 | + <varlistentry> |
| 91 | + <term><replaceable class="parameter">dictionary_name</replaceable></term> |
| 92 | + <listitem> |
| 93 | + <para> |
| 94 | + The name of a text search dictionary to be consulted for the |
| 95 | + specified token type(s). If multiple dictionaries are listed, |
| 96 | + they are consulted in the specified order. |
| 97 | + </para> |
| 98 | + </listitem> |
| 99 | + </varlistentry> |
| 100 | + |
| 101 | + <varlistentry> |
| 102 | + <term><replaceable class="parameter">old_dictionary</replaceable></term> |
| 103 | + <listitem> |
| 104 | + <para> |
| 105 | + The name of a text search dictionary to be replaced in the mapping. |
| 106 | + </para> |
| 107 | + </listitem> |
| 108 | + </varlistentry> |
| 109 | + |
| 110 | + <varlistentry> |
| 111 | + <term><replaceable class="parameter">old_dictionary</replaceable></term> |
| 112 | + <listitem> |
| 113 | + <para> |
| 114 | + The name of a text search dictionary to be substituted for |
| 115 | + <replaceable class="parameter">old_dictionary</replaceable>. |
| 116 | + </para> |
| 117 | + </listitem> |
| 118 | + </varlistentry> |
| 119 | + |
| 120 | + <varlistentry> |
| 121 | + <term><replaceable class="parameter">newname</replaceable></term> |
| 122 | + <listitem> |
| 123 | + <para> |
| 124 | + The new name of the text search configuration. |
| 125 | + </para> |
| 126 | + </listitem> |
| 127 | + </varlistentry> |
| 128 | + |
| 129 | + <varlistentry> |
| 130 | + <term><replaceable class="parameter">newowner</replaceable></term> |
| 131 | + <listitem> |
| 132 | + <para> |
| 133 | + The new owner of the text search configuration. |
| 134 | + </para> |
| 135 | + </listitem> |
| 136 | + </varlistentry> |
| 137 | + </variablelist> |
| 138 | + |
| 139 | + <para> |
| 140 | + The <literal>ADD MAPPING FOR</> form installs a list of dictionaries to be |
| 141 | + consulted for the specified token type(s); it is an error if there is |
| 142 | + already a mapping for any of the token types. |
| 143 | + The <literal>ALTER MAPPING FOR</> form does the same, but first removing |
| 144 | + any existing mapping for those token types. |
| 145 | + The <literal>ALTER MAPPING REPLACE</> forms substitute <replaceable |
| 146 | + class="parameter">new_dictionary</replaceable> for <replaceable |
| 147 | + class="parameter">old_dictionary</replaceable> anywhere the latter appears. |
| 148 | + This is done for only the specified token types when <literal>FOR</> |
| 149 | + appears, or for all mappings of the configuration when it doesn't. |
| 150 | + The <literal>DROP MAPPING</> form removes all dictionaries for the |
| 151 | + specified token type(s), causing tokens of those types to be ignored |
| 152 | + by the text search configuration. It is an error if there is no mapping |
| 153 | + for the token types, unless <literal>IF EXISTS</> appears. |
| 154 | + </para> |
| 155 | + |
| 156 | + </refsect1> |
| 157 | + |
| 158 | + <refsect1> |
| 159 | + <title>Notes</title> |
| 160 | + |
| 161 | + <para> |
| 162 | + While changing the text search parser used by a configuration is allowed, |
| 163 | + this will only work nicely if old and new parsers use the same set of |
| 164 | + token types. It is advisable to drop the mappings for any incompatible |
| 165 | + token types before changing parsers. |
| 166 | + </para> |
| 167 | + |
| 168 | + </refsect1> |
| 169 | + |
| 170 | + <refsect1> |
| 171 | + <title>Examples</title> |
| 172 | + |
| 173 | + <para> |
| 174 | + The following example replaces the <literal>english</> dictionary |
| 175 | + with the <literal>swedish</> dictionary anywhere that <literal>english</> |
| 176 | + is used within <literal>my_config</>. |
| 177 | + </para> |
| 178 | + |
| 179 | +<programlisting> |
| 180 | +ALTER TEXT SEARCH CONFIGURATION my_config |
| 181 | + ALTER MAPPING REPLACE english WITH swedish; |
| 182 | +</programlisting> |
| 183 | + </refsect1> |
| 184 | + |
| 185 | + <refsect1> |
| 186 | + <title>Compatibility</title> |
| 187 | + |
| 188 | + <para> |
| 189 | + There is no <command>ALTER TEXT SEARCH CONFIGURATION</command> statement in |
| 190 | + the SQL standard. |
| 191 | + </para> |
| 192 | + </refsect1> |
| 193 | + |
| 194 | + <refsect1> |
| 195 | + <title>See Also</title> |
| 196 | + |
| 197 | + <simplelist type="inline"> |
| 198 | + <member><xref linkend="sql-createtsconfig" endterm="sql-createtsconfig-title"></member> |
| 199 | + <member><xref linkend="sql-droptsconfig" endterm="sql-droptsconfig-title"></member> |
| 200 | + </simplelist> |
| 201 | + </refsect1> |
| 202 | +</refentry> |
0 commit comments