summaryrefslogtreecommitdiffstats
path: root/doc/src/sgml/ref/alter_tsdictionary.sgml
blob: d1923ef1609fadbe72b45b5019b4acd42b63ea51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!--
doc/src/sgml/ref/alter_tsdictionary.sgml
PostgreSQL documentation
-->

<refentry id="sql-altertsdictionary">
 <indexterm zone="sql-altertsdictionary">
  <primary>ALTER TEXT SEARCH DICTIONARY</primary>
 </indexterm>

 <refmeta>
  <refentrytitle>ALTER TEXT SEARCH DICTIONARY</refentrytitle>
  <manvolnum>7</manvolnum>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>ALTER TEXT SEARCH DICTIONARY</refname>
  <refpurpose>change the definition of a text search dictionary</refpurpose>
 </refnamediv>

 <refsynopsisdiv>
<synopsis>
ALTER TEXT SEARCH DICTIONARY <replaceable>name</replaceable> (
    <replaceable class="parameter">option</replaceable> [ = <replaceable class="parameter">value</replaceable> ] [, ... ]
)
ALTER TEXT SEARCH DICTIONARY <replaceable>name</replaceable> RENAME TO <replaceable>new_name</replaceable>
ALTER TEXT SEARCH DICTIONARY <replaceable>name</replaceable> OWNER TO { <replaceable>new_owner</replaceable> | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
ALTER TEXT SEARCH DICTIONARY <replaceable>name</replaceable> SET SCHEMA <replaceable>new_schema</replaceable>
</synopsis>
 </refsynopsisdiv>

 <refsect1>
  <title>Description</title>

  <para>
   <command>ALTER TEXT SEARCH DICTIONARY</command> changes the definition of
   a text search dictionary.  You can change the dictionary's
   template-specific options, or change the dictionary's name or owner.
  </para>

  <para>
   You must be the owner of the dictionary to use
   <command>ALTER TEXT SEARCH DICTIONARY</command>.
  </para>
 </refsect1>

 <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
      dictionary.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">option</replaceable></term>
    <listitem>
     <para>
      The name of a template-specific option to be set for this dictionary.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">value</replaceable></term>
    <listitem>
     <para>
      The new value to use for a template-specific option.
      If the equal sign and value are omitted, then any previous
      setting for the option is removed from the dictionary,
      allowing the default to be used.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">new_name</replaceable></term>
    <listitem>
     <para>
      The new name of the text search dictionary.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">new_owner</replaceable></term>
    <listitem>
     <para>
      The new owner of the text search dictionary.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">new_schema</replaceable></term>
    <listitem>
     <para>
      The new schema for the text search dictionary.
     </para>
    </listitem>
   </varlistentry>
 </variablelist>

  <para>
   Template-specific options can appear in any order.
  </para>
 </refsect1>

 <refsect1>
  <title>Examples</title>

  <para>
   The following example command changes the stopword list
   for a Snowball-based dictionary.  Other parameters remain unchanged.
  </para>

<programlisting>
ALTER TEXT SEARCH DICTIONARY my_dict ( StopWords = newrussian );
</programlisting>

  <para>
   The following example command changes the language option to <literal>dutch</literal>,
   and removes the stopword option entirely.
  </para>

<programlisting>
ALTER TEXT SEARCH DICTIONARY my_dict ( language = dutch, StopWords );
</programlisting>

  <para>
   The following example command <quote>updates</quote> the dictionary's
   definition without actually changing anything.

<programlisting>
ALTER TEXT SEARCH DICTIONARY my_dict ( dummy );
</programlisting>

   (The reason this works is that the option removal code doesn't complain
   if there is no such option.)  This trick is useful when changing
   configuration files for the dictionary: the <command>ALTER</command> will
   force existing database sessions to re-read the configuration files,
   which otherwise they would never do if they had read them earlier.
  </para>
 </refsect1>

 <refsect1>
  <title>Compatibility</title>

  <para>
   There is no <command>ALTER TEXT SEARCH DICTIONARY</command> statement in
   the SQL standard.
  </para>
 </refsect1>

 <refsect1>
  <title>See Also</title>

  <simplelist type="inline">
   <member><xref linkend="sql-createtsdictionary"/></member>
   <member><xref linkend="sql-droptsdictionary"/></member>
  </simplelist>
 </refsect1>
</refentry>