|
|
|
@ -1,4 +1,4 @@ |
|
|
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/charset.sgml,v 2.46 2004/11/15 06:32:13 neilc Exp $ --> |
|
|
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/charset.sgml,v 2.47 2004/12/27 22:30:10 tgl Exp $ --> |
|
|
|
|
|
|
|
|
|
|
|
<chapter id="charset"> |
|
|
|
<chapter id="charset"> |
|
|
|
<title>Localization</> |
|
|
|
<title>Localization</> |
|
|
|
@ -72,14 +72,15 @@ initdb --locale=sv_SE |
|
|
|
locale then the specifications look like this: |
|
|
|
locale then the specifications look like this: |
|
|
|
<literal>cs_CZ.ISO8859-2</>. What locales are available under what |
|
|
|
<literal>cs_CZ.ISO8859-2</>. What locales are available under what |
|
|
|
names on your system depends on what was provided by the operating |
|
|
|
names on your system depends on what was provided by the operating |
|
|
|
system vendor and what was installed. |
|
|
|
system vendor and what was installed. (On most systems, the command |
|
|
|
|
|
|
|
<literal>locale -a</> will provide a list of available locales.) |
|
|
|
</para> |
|
|
|
</para> |
|
|
|
|
|
|
|
|
|
|
|
<para> |
|
|
|
<para> |
|
|
|
Occasionally it is useful to mix rules from several locales, e.g., |
|
|
|
Occasionally it is useful to mix rules from several locales, e.g., |
|
|
|
use English collation rules but Spanish messages. To support that, a |
|
|
|
use English collation rules but Spanish messages. To support that, a |
|
|
|
set of locale subcategories exist that control only a certain |
|
|
|
set of locale subcategories exist that control only a certain |
|
|
|
aspect of the localization rules. |
|
|
|
aspect of the localization rules: |
|
|
|
|
|
|
|
|
|
|
|
<informaltable> |
|
|
|
<informaltable> |
|
|
|
<tgroup cols="2"> |
|
|
|
<tgroup cols="2"> |
|
|
|
@ -90,7 +91,7 @@ initdb --locale=sv_SE |
|
|
|
</row> |
|
|
|
</row> |
|
|
|
<row> |
|
|
|
<row> |
|
|
|
<entry><envar>LC_CTYPE</></> |
|
|
|
<entry><envar>LC_CTYPE</></> |
|
|
|
<entry>Character classification (What is a letter? The upper-case equivalent?)</> |
|
|
|
<entry>Character classification (What is a letter? Its upper-case equivalent?)</> |
|
|
|
</row> |
|
|
|
</row> |
|
|
|
<row> |
|
|
|
<row> |
|
|
|
<entry><envar>LC_MESSAGES</></> |
|
|
|
<entry><envar>LC_MESSAGES</></> |
|
|
|
@ -154,7 +155,7 @@ initdb --locale=sv_SE |
|
|
|
environment variables seen by the server, not by the environment |
|
|
|
environment variables seen by the server, not by the environment |
|
|
|
of any client. Therefore, be careful to configure the correct locale settings |
|
|
|
of any client. Therefore, be careful to configure the correct locale settings |
|
|
|
before starting the server. A consequence of this is that if |
|
|
|
before starting the server. A consequence of this is that if |
|
|
|
client and server are set up to different locales, messages may |
|
|
|
client and server are set up in different locales, messages may |
|
|
|
appear in different languages depending on where they originated. |
|
|
|
appear in different languages depending on where they originated. |
|
|
|
</para> |
|
|
|
</para> |
|
|
|
|
|
|
|
|
|
|
|
@ -181,7 +182,7 @@ initdb --locale=sv_SE |
|
|
|
</note> |
|
|
|
</note> |
|
|
|
|
|
|
|
|
|
|
|
<para> |
|
|
|
<para> |
|
|
|
To enable messages translated to the user's preferred language, |
|
|
|
To enable messages to be translated to the user's preferred language, |
|
|
|
<acronym>NLS</acronym> must have been enabled at build time. This |
|
|
|
<acronym>NLS</acronym> must have been enabled at build time. This |
|
|
|
choice is independent of the other locale support. |
|
|
|
choice is independent of the other locale support. |
|
|
|
</para> |
|
|
|
</para> |
|
|
|
@ -234,8 +235,8 @@ initdb --locale=sv_SE |
|
|
|
changed without repeating <command>initdb</>. Other locale |
|
|
|
changed without repeating <command>initdb</>. Other locale |
|
|
|
settings including <envar>LC_MESSAGES</> and <envar>LC_MONETARY</> |
|
|
|
settings including <envar>LC_MESSAGES</> and <envar>LC_MONETARY</> |
|
|
|
are initially determined by the environment the server is started |
|
|
|
are initially determined by the environment the server is started |
|
|
|
in. You can check the <envar>LC_COLLATE</> and <envar>LC_CTYPE</> |
|
|
|
in, but can be changed on-the-fly. You can check the active locale |
|
|
|
settings of a database using the <command>SHOW</> command. |
|
|
|
settings using the <command>SHOW</> command. |
|
|
|
</para> |
|
|
|
</para> |
|
|
|
|
|
|
|
|
|
|
|
<para> |
|
|
|
<para> |
|
|
|
@ -256,9 +257,9 @@ initdb --locale=sv_SE |
|
|
|
Maintaining catalogs of message translations requires the on-going |
|
|
|
Maintaining catalogs of message translations requires the on-going |
|
|
|
efforts of many volunteers that want to see |
|
|
|
efforts of many volunteers that want to see |
|
|
|
<productname>PostgreSQL</> speak their preferred language well. |
|
|
|
<productname>PostgreSQL</> speak their preferred language well. |
|
|
|
If messages in your language is currently not available or fully |
|
|
|
If messages in your language are currently not available or not fully |
|
|
|
translated, your assistance would be appreciated. If you want to |
|
|
|
translated, your assistance would be appreciated. If you want to |
|
|
|
help, refer to the <xref linkend="nls"> or write to the developers' |
|
|
|
help, refer to <xref linkend="nls"> or write to the developers' |
|
|
|
mailing list. |
|
|
|
mailing list. |
|
|
|
</para> |
|
|
|
</para> |
|
|
|
</sect2> |
|
|
|
</sect2> |
|
|
|
@ -498,6 +499,31 @@ $ <userinput>psql -l</userinput> |
|
|
|
(9 rows) |
|
|
|
(9 rows) |
|
|
|
</screen> |
|
|
|
</screen> |
|
|
|
</para> |
|
|
|
</para> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<important> |
|
|
|
|
|
|
|
<para> |
|
|
|
|
|
|
|
Although you can specify any encoding you want for a database, it is |
|
|
|
|
|
|
|
unwise to choose an encoding that is not what is expected by the locale |
|
|
|
|
|
|
|
you have selected. The <literal>LC_COLLATE</literal> and |
|
|
|
|
|
|
|
<literal>LC_CTYPE</literal> settings imply a particular encoding, |
|
|
|
|
|
|
|
and locale-dependent operations (such as sorting) are likely to |
|
|
|
|
|
|
|
misinterpret data that is in an incompatible encoding. |
|
|
|
|
|
|
|
</para> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<para> |
|
|
|
|
|
|
|
Since these locale settings are frozen by <command>initdb</>, the |
|
|
|
|
|
|
|
apparent flexibility to use different encodings in different databases |
|
|
|
|
|
|
|
of a cluster is more theoretical than real. It is likely that these |
|
|
|
|
|
|
|
mechanisms will be revisited in future versions of |
|
|
|
|
|
|
|
<productname>PostgreSQL</productname>. |
|
|
|
|
|
|
|
</para> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<para> |
|
|
|
|
|
|
|
One way to use multiple encodings safely is to set the locale to |
|
|
|
|
|
|
|
<literal>C</> or <literal>POSIX</> during <command>initdb</>, thus |
|
|
|
|
|
|
|
disabling any real locale awareness. |
|
|
|
|
|
|
|
</para> |
|
|
|
|
|
|
|
</important> |
|
|
|
</sect2> |
|
|
|
</sect2> |
|
|
|
|
|
|
|
|
|
|
|
<sect2> |
|
|
|
<sect2> |
|
|
|
@ -805,7 +831,7 @@ RESET client_encoding; |
|
|
|
|
|
|
|
|
|
|
|
<listitem> |
|
|
|
<listitem> |
|
|
|
<para> |
|
|
|
<para> |
|
|
|
Using <envar>PGCLIENTENCODING</envar>. If environment variable |
|
|
|
Using <envar>PGCLIENTENCODING</envar>. If the environment variable |
|
|
|
<envar>PGCLIENTENCODING</envar> is defined in the client's |
|
|
|
<envar>PGCLIENTENCODING</envar> is defined in the client's |
|
|
|
environment, that client encoding is automatically selected |
|
|
|
environment, that client encoding is automatically selected |
|
|
|
when a connection to the server is made. (This can |
|
|
|
when a connection to the server is made. (This can |
|
|
|
|