]> begriffs open source - ai-pg/blob - full-docs/src/sgml/html/locale.html
PG 18 docs from https://ftp.postgresql.org/pub/source/v18.0/postgresql-18.0-docs...
[ai-pg] / full-docs / src / sgml / html / locale.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>23.1. Locale Support</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="charset.html" title="Chapter 23. Localization" /><link rel="next" href="collation.html" title="23.2. Collation Support" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">23.1. Locale Support</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="charset.html" title="Chapter 23. Localization">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="charset.html" title="Chapter 23. Localization">Up</a></td><th width="60%" align="center">Chapter 23. Localization</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="collation.html" title="23.2. Collation Support">Next</a></td></tr></table><hr /></div><div class="sect1" id="LOCALE"><div class="titlepage"><div><div><h2 class="title" style="clear: both">23.1. Locale Support <a href="#LOCALE" class="id_link">#</a></h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="locale.html#LOCALE-OVERVIEW">23.1.1. Overview</a></span></dt><dt><span class="sect2"><a href="locale.html#LOCALE-BEHAVIOR">23.1.2. Behavior</a></span></dt><dt><span class="sect2"><a href="locale.html#LOCALE-SELECTING-LOCALES">23.1.3. Selecting Locales</a></span></dt><dt><span class="sect2"><a href="locale.html#LOCALE-PROVIDERS">23.1.4. Locale Providers</a></span></dt><dt><span class="sect2"><a href="locale.html#ICU-LOCALES">23.1.5. ICU Locales</a></span></dt><dt><span class="sect2"><a href="locale.html#LOCALE-PROBLEMS">23.1.6. Problems</a></span></dt></dl></div><a id="id-1.6.10.3.2" class="indexterm"></a><p>
3    <em class="firstterm">Locale</em> support refers to an application respecting
4    cultural preferences regarding alphabets, sorting, number
5    formatting, etc.  <span class="productname">PostgreSQL</span> uses the standard ISO
6    C and <acronym class="acronym">POSIX</acronym> locale facilities provided by the server operating
7    system.  For additional information refer to the documentation of your
8    system.
9   </p><div class="sect2" id="LOCALE-OVERVIEW"><div class="titlepage"><div><div><h3 class="title">23.1.1. Overview <a href="#LOCALE-OVERVIEW" class="id_link">#</a></h3></div></div></div><p>
10     Locale support is automatically initialized when a database
11     cluster is created using <code class="command">initdb</code>.
12     <code class="command">initdb</code> will initialize the database cluster
13     with the locale setting of its execution environment by default,
14     so if your system is already set to use the locale that you want
15     in your database cluster then there is nothing else you need to
16     do.  If you want to use a different locale (or you are not sure
17     which locale your system is set to), you can instruct
18     <code class="command">initdb</code> exactly which locale to use by
19     specifying the <code class="option">--locale</code> option. For example:
20 </p><pre class="screen">
21 initdb --locale=sv_SE
22 </pre><p>
23    </p><p>
24     This example for Unix systems sets the locale to Swedish
25     (<code class="literal">sv</code>) as spoken
26     in Sweden (<code class="literal">SE</code>).  Other possibilities might include
27     <code class="literal">en_US</code> (U.S. English) and <code class="literal">fr_CA</code> (French
28     Canadian).  If more than one character set can be used for a
29     locale then the specifications can take the form
30     <em class="replaceable"><code>language_territory.codeset</code></em>.  For example,
31     <code class="literal">fr_BE.UTF-8</code> represents the French language (fr) as
32     spoken in Belgium (BE), with a <acronym class="acronym">UTF-8</acronym> character set
33     encoding.
34    </p><p>
35     What locales are available on your
36     system under what names depends on what was provided by the operating
37     system vendor and what was installed.  On most Unix systems, the command
38     <code class="literal">locale -a</code> will provide a list of available locales.
39     Windows uses more verbose locale names, such as <code class="literal">German_Germany</code>
40     or <code class="literal">Swedish_Sweden.1252</code>, but the principles are the same.
41    </p><p>
42     Occasionally it is useful to mix rules from several locales, e.g.,
43     use English collation rules but Spanish messages.  To support that, a
44     set of locale subcategories exist that control only certain
45     aspects of the localization rules:
46
47     </p><div class="informaltable"><table class="informaltable" border="1"><colgroup><col class="col1" /><col class="col2" /></colgroup><tbody><tr><td><code class="envar">LC_COLLATE</code></td><td>String sort order</td></tr><tr><td><code class="envar">LC_CTYPE</code></td><td>Character classification (What is a letter? Its upper-case equivalent?)</td></tr><tr><td><code class="envar">LC_MESSAGES</code></td><td>Language of messages</td></tr><tr><td><code class="envar">LC_MONETARY</code></td><td>Formatting of currency amounts</td></tr><tr><td><code class="envar">LC_NUMERIC</code></td><td>Formatting of numbers</td></tr><tr><td><code class="envar">LC_TIME</code></td><td>Formatting of dates and times</td></tr></tbody></table></div><p>
48
49     The category names translate into names of
50     <code class="command">initdb</code> options to override the locale choice
51     for a specific category.  For instance, to set the locale to
52     French Canadian, but use U.S. rules for formatting currency, use
53     <code class="literal">initdb --locale=fr_CA --lc-monetary=en_US</code>.
54    </p><p>
55     If you want the system to behave as if it had no locale support,
56     use the special locale name <code class="literal">C</code>, or equivalently
57     <code class="literal">POSIX</code>.
58    </p><p>
59     Some locale categories must have their values
60     fixed when the database is created.  You can use different settings
61     for different databases, but once a database is created, you cannot
62     change them for that database anymore. <code class="literal">LC_COLLATE</code>
63     and <code class="literal">LC_CTYPE</code> are these categories.  They affect
64     the sort order of indexes, so they must be kept fixed, or indexes on
65     text columns would become corrupt.
66     (But you can alleviate this restriction using collations, as discussed
67     in <a class="xref" href="collation.html" title="23.2. Collation Support">Section 23.2</a>.)
68     The default values for these
69     categories are determined when <code class="command">initdb</code> is run, and
70     those values are used when new databases are created, unless
71     specified otherwise in the <code class="command">CREATE DATABASE</code> command.
72    </p><p>
73     The other locale categories can be changed whenever desired
74     by setting the server configuration parameters
75     that have the same name as the locale categories (see <a class="xref" href="runtime-config-client.html#RUNTIME-CONFIG-CLIENT-FORMAT" title="19.11.2. Locale and Formatting">Section 19.11.2</a> for details).  The values
76     that are chosen by <code class="command">initdb</code> are actually only written
77     into the configuration file <code class="filename">postgresql.conf</code> to
78     serve as defaults when the server is started.  If you remove these
79     assignments from <code class="filename">postgresql.conf</code> then the
80     server will inherit the settings from its execution environment.
81    </p><p>
82     Note that the locale behavior of the server is determined by the
83     environment variables seen by the server, not by the environment
84     of any client.  Therefore, be careful to configure the correct locale settings
85     before starting the server.  A consequence of this is that if
86     client and server are set up in different locales, messages might
87     appear in different languages depending on where they originated.
88    </p><div class="note"><h3 class="title">Note</h3><p>
89      When we speak of inheriting the locale from the execution
90      environment, this means the following on most operating systems:
91      For a given locale category, say the collation, the following
92      environment variables are consulted in this order until one is
93      found to be set: <code class="envar">LC_ALL</code>, <code class="envar">LC_COLLATE</code>
94      (or the variable corresponding to the respective category),
95      <code class="envar">LANG</code>.  If none of these environment variables are
96      set then the locale defaults to <code class="literal">C</code>.
97     </p><p>
98      Some message localization libraries also look at the environment
99      variable <code class="envar">LANGUAGE</code> which overrides all other locale
100      settings for the purpose of setting the language of messages.  If
101      in doubt, please refer to the documentation of your operating
102      system, in particular the documentation about
103      <span class="application">gettext</span>.
104     </p></div><p>
105     To enable messages to be translated to the user's preferred language,
106     <acronym class="acronym">NLS</acronym> must have been selected at build time
107     (<code class="literal">configure --enable-nls</code>).  All other locale support is
108     built in automatically.
109    </p></div><div class="sect2" id="LOCALE-BEHAVIOR"><div class="titlepage"><div><div><h3 class="title">23.1.2. Behavior <a href="#LOCALE-BEHAVIOR" class="id_link">#</a></h3></div></div></div><p>
110     The locale settings influence the following SQL features:
111
112     </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
113        Sort order in queries using <code class="literal">ORDER BY</code> or the standard
114        comparison operators on textual data
115        <a id="id-1.6.10.3.5.2.1.1.1.2" class="indexterm"></a>
116       </p></li><li class="listitem"><p>
117        The <code class="function">upper</code>, <code class="function">lower</code>, and <code class="function">initcap</code>
118        functions
119        <a id="id-1.6.10.3.5.2.1.2.1.4" class="indexterm"></a>
120        <a id="id-1.6.10.3.5.2.1.2.1.5" class="indexterm"></a>
121       </p></li><li class="listitem"><p>
122        Pattern matching operators (<code class="literal">LIKE</code>, <code class="literal">SIMILAR TO</code>,
123        and POSIX-style regular expressions); locales affect both case
124        insensitive matching and the classification of characters by
125        character-class regular expressions
126        <a id="id-1.6.10.3.5.2.1.3.1.3" class="indexterm"></a>
127        <a id="id-1.6.10.3.5.2.1.3.1.4" class="indexterm"></a>
128       </p></li><li class="listitem"><p>
129        The <code class="function">to_char</code> family of functions
130        <a id="id-1.6.10.3.5.2.1.4.1.2" class="indexterm"></a>
131       </p></li><li class="listitem"><p>
132        The ability to use indexes with <code class="literal">LIKE</code> clauses
133       </p></li></ul></div><p>
134    </p><p>
135     The drawback of using locales other than <code class="literal">C</code> or
136     <code class="literal">POSIX</code> in <span class="productname">PostgreSQL</span> is its performance
137     impact. It slows character handling and prevents ordinary indexes
138     from being used by <code class="literal">LIKE</code>. For this reason use locales
139     only if you actually need them.
140    </p><p>
141     As a workaround to allow <span class="productname">PostgreSQL</span> to use indexes
142     with <code class="literal">LIKE</code> clauses under a non-C locale, several custom
143     operator classes exist. These allow the creation of an index that
144     performs a strict character-by-character comparison, ignoring
145     locale comparison rules. Refer to <a class="xref" href="indexes-opclass.html" title="11.10. Operator Classes and Operator Families">Section 11.10</a>
146     for more information.  Another approach is to create indexes using
147     the <code class="literal">C</code> collation, as discussed in
148     <a class="xref" href="collation.html" title="23.2. Collation Support">Section 23.2</a>.
149    </p></div><div class="sect2" id="LOCALE-SELECTING-LOCALES"><div class="titlepage"><div><div><h3 class="title">23.1.3. Selecting Locales <a href="#LOCALE-SELECTING-LOCALES" class="id_link">#</a></h3></div></div></div><p>
150     Locales can be selected in different scopes depending on requirements.
151     The above overview showed how locales are specified using
152     <code class="command">initdb</code> to set the defaults for the entire cluster.  The
153     following list shows where locales can be selected.  Each item provides
154     the defaults for the subsequent items, and each lower item allows
155     overriding the defaults on a finer granularity.
156    </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
157       As explained above, the environment of the operating system provides the
158       defaults for the locales of a newly initialized database cluster.  In
159       many cases, this is enough: if the operating system is configured for
160       the desired language/territory, by default
161       <span class="productname">PostgreSQL</span> will also behave according
162       to that locale.
163      </p></li><li class="listitem"><p>
164       As shown above, command-line options for <code class="command">initdb</code>
165       specify the locale settings for a newly initialized database cluster.
166       Use this if the operating system does not have the locale configuration
167       you want for your database system.
168      </p></li><li class="listitem"><p>
169       A locale can be selected separately for each database.  The SQL command
170       <code class="command">CREATE DATABASE</code> and its command-line equivalent
171       <code class="command">createdb</code> have options for that.  Use this for example
172       if a database cluster houses databases for multiple tenants with
173       different requirements.
174      </p></li><li class="listitem"><p>
175       Locale settings can be made for individual table columns.  This uses an
176       SQL object called <em class="firstterm">collation</em> and is explained in
177       <a class="xref" href="collation.html" title="23.2. Collation Support">Section 23.2</a>.  Use this for example to sort data in
178       different languages or customize the sort order of a particular table.
179      </p></li><li class="listitem"><p>
180       Finally, locales can be selected for an individual query.  Again, this
181       uses SQL collation objects.  This could be used to change the sort order
182       based on run-time choices or for ad-hoc experimentation.
183      </p></li></ol></div></div><div class="sect2" id="LOCALE-PROVIDERS"><div class="titlepage"><div><div><h3 class="title">23.1.4. Locale Providers <a href="#LOCALE-PROVIDERS" class="id_link">#</a></h3></div></div></div><p>
184     A locale provider specifies which library defines the locale behavior for
185     collations and character classifications.
186    </p><p>
187     The commands and tools that select the locale settings, as described
188     above, each have an option to select the locale provider. Here is an
189     example to initialize a database cluster using the ICU provider:
190 </p><pre class="programlisting">
191 initdb --locale-provider=icu --icu-locale=en
192 </pre><p>
193     See the description of the respective commands and programs for
194     details.  Note that you can mix locale providers at different
195     granularities, for example use <code class="literal">libc</code> by default for the
196     cluster but have one database that uses the <code class="literal">icu</code>
197     provider, and then have collation objects using either provider within
198     those databases.
199    </p><p>
200     Regardless of the locale provider, the operating system is still used to
201     provide some locale-aware behavior, such as messages (see <a class="xref" href="runtime-config-client.html#GUC-LC-MESSAGES">lc_messages</a>).
202    </p><p>
203     The available locale providers are listed below:
204    </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="literal">builtin</code></span></dt><dd><p>
205        The <code class="literal">builtin</code> provider uses built-in operations. Only
206        the <code class="literal">C</code>, <code class="literal">C.UTF-8</code>, and
207        <code class="literal">PG_UNICODE_FAST</code> locales are supported for this
208        provider.
209       </p><p>
210        The <code class="literal">C</code> locale behavior is identical to the
211        <code class="literal">C</code> locale in the libc provider. When using this
212        locale, the behavior may depend on the database encoding.
213       </p><p>
214        The <code class="literal">C.UTF-8</code> locale is available only for when the
215        database encoding is <code class="literal">UTF-8</code>, and the behavior is
216        based on Unicode. The collation uses the code point values only. The
217        regular expression character classes are based on the "POSIX
218        Compatible" semantics, and the case mapping is the "simple" variant.
219       </p><p>
220        The <code class="literal">PG_UNICODE_FAST</code> locale is available only when
221        the database encoding is <code class="literal">UTF-8</code>, and the behavior is
222        based on Unicode. The collation uses the code point values only. The
223        regular expression character classes are based on the "Standard"
224        semantics, and the case mapping is the "full" variant.
225       </p></dd><dt><span class="term"><code class="literal">icu</code></span></dt><dd><p>
226        The <code class="literal">icu</code> provider uses the external
227        ICU<a id="id-1.6.10.3.7.6.2.2.1.2" class="indexterm"></a>
228        library. <span class="productname">PostgreSQL</span> must have been
229        configured with support.
230       </p><p>
231        ICU provides collation and character classification behavior that is
232        independent of the operating system and database encoding, which is
233        preferable if you expect to transition to other platforms without any
234        change in results. <code class="literal">LC_COLLATE</code> and
235        <code class="literal">LC_CTYPE</code> can be set independently of the ICU
236        locale.
237       </p><div class="note"><h3 class="title">Note</h3><p>
238         For the ICU provider, results may depend on the version of the ICU
239         library used, as it is updated to reflect changes in natural language
240         over time.
241        </p></div></dd><dt><span class="term"><code class="literal">libc</code></span></dt><dd><p>
242        The <code class="literal">libc</code> provider uses the operating system's C
243        library. The collation and character classification behavior is
244        controlled by the settings <code class="literal">LC_COLLATE</code> and
245        <code class="literal">LC_CTYPE</code>, so they cannot be set independently.
246       </p><div class="note"><h3 class="title">Note</h3><p>
247         The same locale name may have different behavior on different
248         platforms when using the libc provider.
249        </p></div></dd></dl></div></div><div class="sect2" id="ICU-LOCALES"><div class="titlepage"><div><div><h3 class="title">23.1.5. ICU Locales <a href="#ICU-LOCALES" class="id_link">#</a></h3></div></div></div><div class="sect3" id="ICU-LOCALE-NAMES"><div class="titlepage"><div><div><h4 class="title">23.1.5.1. ICU Locale Names <a href="#ICU-LOCALE-NAMES" class="id_link">#</a></h4></div></div></div><p>
250      The ICU format for the locale name is a <a class="link" href="locale.html#ICU-LANGUAGE-TAG" title="23.1.5.3. Language Tag">Language Tag</a>.
251
252 </p><pre class="programlisting">
253 CREATE COLLATION mycollation1 (provider = icu, locale = 'ja-JP');
254 CREATE COLLATION mycollation2 (provider = icu, locale = 'fr');
255 </pre><p>
256     </p></div><div class="sect3" id="ICU-CANONICALIZATION"><div class="titlepage"><div><div><h4 class="title">23.1.5.2. Locale Canonicalization and Validation <a href="#ICU-CANONICALIZATION" class="id_link">#</a></h4></div></div></div><p>
257      When defining a new ICU collation object or database with ICU as the
258      provider, the given locale name is transformed ("canonicalized") into a
259      language tag if not already in that form. For instance,
260
261 </p><pre class="screen">
262 CREATE COLLATION mycollation3 (provider = icu, locale = 'en-US-u-kn-true');
263 NOTICE:  using standard form "en-US-u-kn" for locale "en-US-u-kn-true"
264 CREATE COLLATION mycollation4 (provider = icu, locale = 'de_DE.utf8');
265 NOTICE:  using standard form "de-DE" for locale "de_DE.utf8"
266 </pre><p>
267
268      If you see this notice, ensure that the <code class="symbol">provider</code> and
269      <code class="symbol">locale</code> are the expected result. For consistent results
270      when using the ICU provider, specify the canonical <a class="link" href="locale.html#ICU-LANGUAGE-TAG" title="23.1.5.3. Language Tag">language tag</a> instead of relying on the
271      transformation.
272     </p><p>
273      A locale with no language name, or the special language name
274      <code class="literal">root</code>, is transformed to have the language
275      <code class="literal">und</code> ("undefined").
276     </p><p>
277      ICU can transform most libc locale names, as well as some other formats,
278      into language tags for easier transition to ICU. If a libc locale name is
279      used in ICU, it may not have precisely the same behavior as in libc.
280     </p><p>
281      If there is a problem interpreting the locale name, or if the locale name
282      represents a language or region that ICU does not recognize, you will see
283      the following warning:
284
285 </p><pre class="screen">
286 CREATE COLLATION nonsense (provider = icu, locale = 'nonsense');
287 WARNING:  ICU locale "nonsense" has unknown language "nonsense"
288 HINT:  To disable ICU locale validation, set parameter icu_validation_level to DISABLED.
289 CREATE COLLATION
290 </pre><p>
291
292      <a class="xref" href="runtime-config-client.html#GUC-ICU-VALIDATION-LEVEL">icu_validation_level</a> controls how the message is
293      reported. Unless set to <code class="literal">ERROR</code>, the collation will
294      still be created, but the behavior may not be what the user intended.
295     </p></div><div class="sect3" id="ICU-LANGUAGE-TAG"><div class="titlepage"><div><div><h4 class="title">23.1.5.3. Language Tag <a href="#ICU-LANGUAGE-TAG" class="id_link">#</a></h4></div></div></div><p>
296      A language tag, defined in BCP 47, is a standardized identifier used to
297      identify languages, regions, and other information about a locale.
298     </p><p>
299      Basic language tags are simply
300      <em class="replaceable"><code>language</code></em><code class="literal">-</code><em class="replaceable"><code>region</code></em>;
301      or even just <em class="replaceable"><code>language</code></em>. The
302      <em class="replaceable"><code>language</code></em> is a language code
303      (e.g. <code class="literal">fr</code> for French), and
304      <em class="replaceable"><code>region</code></em> is a region code
305      (e.g. <code class="literal">CA</code> for Canada). Examples:
306      <code class="literal">ja-JP</code>, <code class="literal">de</code>, or
307      <code class="literal">fr-CA</code>.
308     </p><p>
309      Collation settings may be included in the language tag to customize
310      collation behavior. ICU allows extensive customization, such as
311      sensitivity (or insensitivity) to accents, case, and punctuation;
312      treatment of digits within text; and many other options to satisfy a
313      variety of uses.
314     </p><p>
315      To include this additional collation information in a language tag,
316      append <code class="literal">-u</code>, which indicates there are additional
317      collation settings, followed by one or more
318      <code class="literal">-</code><em class="replaceable"><code>key</code></em><code class="literal">-</code><em class="replaceable"><code>value</code></em>
319      pairs. The <em class="replaceable"><code>key</code></em> is the key for a <a class="link" href="collation.html#ICU-COLLATION-SETTINGS" title="23.2.3.2. Collation Settings for an ICU Locale">collation setting</a> and
320      <em class="replaceable"><code>value</code></em> is a valid value for that setting. For
321      boolean settings, the <code class="literal">-</code><em class="replaceable"><code>key</code></em>
322      may be specified without a corresponding
323      <code class="literal">-</code><em class="replaceable"><code>value</code></em>, which implies a
324      value of <code class="literal">true</code>.
325     </p><p>
326      For example, the language tag <code class="literal">en-US-u-kn-ks-level2</code>
327      means the locale with the English language in the US region, with
328      collation settings <code class="literal">kn</code> set to <code class="literal">true</code>
329      and <code class="literal">ks</code> set to <code class="literal">level2</code>. Those
330      settings mean the collation will be case-insensitive and treat a sequence
331      of digits as a single number:
332
333 </p><pre class="screen">
334 CREATE COLLATION mycollation5 (provider = icu, deterministic = false, locale = 'en-US-u-kn-ks-level2');
335 SELECT 'aB' = 'Ab' COLLATE mycollation5 as result;
336  result
337 --------
338  t
339 (1 row)
340
341 SELECT 'N-45' &lt; 'N-123' COLLATE mycollation5 as result;
342  result
343 --------
344  t
345 (1 row)
346 </pre><p>
347     </p><p>
348      See <a class="xref" href="collation.html#ICU-CUSTOM-COLLATIONS" title="23.2.3. ICU Custom Collations">Section 23.2.3</a> for details and additional
349      examples of using language tags with custom collation information for the
350      locale.
351     </p></div></div><div class="sect2" id="LOCALE-PROBLEMS"><div class="titlepage"><div><div><h3 class="title">23.1.6. Problems <a href="#LOCALE-PROBLEMS" class="id_link">#</a></h3></div></div></div><p>
352     If locale support doesn't work according to the explanation above,
353     check that the locale support in your operating system is
354     correctly configured.  To check what locales are installed on your
355     system, you can use the command <code class="literal">locale -a</code> if
356     your operating system provides it.
357    </p><p>
358     Check that <span class="productname">PostgreSQL</span> is actually using the locale
359     that you think it is.  The <code class="envar">LC_COLLATE</code> and <code class="envar">LC_CTYPE</code>
360     settings are determined when a database is created, and cannot be
361     changed except by creating a new database.  Other locale
362     settings including <code class="envar">LC_MESSAGES</code> and <code class="envar">LC_MONETARY</code>
363     are initially determined by the environment the server is started
364     in, but can be changed on-the-fly.  You can check the active locale
365     settings using the <code class="command">SHOW</code> command.
366    </p><p>
367     The directory <code class="filename">src/test/locale</code> in the source
368     distribution contains a test suite for
369     <span class="productname">PostgreSQL</span>'s locale support.
370    </p><p>
371     Client applications that handle server-side errors by parsing the
372     text of the error message will obviously have problems when the
373     server's messages are in a different language.  Authors of such
374     applications are advised to make use of the error code scheme
375     instead.
376    </p><p>
377     Maintaining catalogs of message translations requires the on-going
378     efforts of many volunteers that want to see
379     <span class="productname">PostgreSQL</span> speak their preferred language well.
380     If messages in your language are currently not available or not fully
381     translated, your assistance would be appreciated.  If you want to
382     help, refer to <a class="xref" href="nls.html" title="Chapter 56. Native Language Support">Chapter 56</a> or write to the developers'
383     mailing list.
384    </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="charset.html" title="Chapter 23. Localization">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="charset.html" title="Chapter 23. Localization">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="collation.html" title="23.2. Collation Support">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 23. Localization </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"> 23.2. Collation Support</td></tr></table></div></body></html>