diff options
Diffstat (limited to 'doc/src/sgml/runtime.sgml')
| -rw-r--r-- | doc/src/sgml/runtime.sgml | 121 |
1 files changed, 120 insertions, 1 deletions
diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index 0413fc11cc5..cc6900ece43 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -1,5 +1,5 @@ <!-- -$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.13 2000/07/12 17:38:41 petere Exp $ +$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.14 2000/07/15 21:35:47 petere Exp $ --> <Chapter Id="runtime"> @@ -1036,6 +1036,125 @@ env PGOPTIONS='--geqo=off' psql </sect2> </sect1> + + <sect1 id="locale"> + <title>Locale Support</title> + + <note> + <title>Acknowledgement</title> + <para> + Written by Oleg Bartunov. See <ulink + url="http://www.sai.msu.su/~megera/postgres/">Oleg's web + page</ulink> for additional information on locale and Russian + language support. + </para> + </note> + + <para> + While doing a project for a company in Moscow, Russia, I + encountered the problem that <productname>Postgres</> had no + support of national alphabets. After looking for possible + workarounds I decided to develop support of locale myself. I'm not + a C programmer but already had some experience with locale + programming when I work with <productname>Perl</> (debugging) and + <productname>Glimpse</>. After several days of digging through the + <productname>Postgres</> source tree I made very minor corections + to <filename>src/backend/utils/adt/varlena.c</> and + <filename>src/backend/main/main.c</> and got what I needed! I did + support only for <envar>LC_CTYPE</envar> and + <envar>LC_COLLATE</envar>, but later <envar>LC_MONETARY</envar> was + added by others. I got many messages from people about this patch + so I decided to send it to developers and (to my surprise) it was + incorporated into the <productname>Postgres</> distribution. + </para> + + <para> + People often complain that locale doesn't work for them. There are + several common mistakes: + + <itemizedlist> + <listitem> + <para> + Didn't properly configure <productname>Postgres</> before + compilation. You must run <filename>configure</> with the + <option>--enable-locale</> option to enable locale support. + </para> + </listitem> + + <listitem> + <para> + Didn't setup environment correctly when starting postmaster. You + must define environment variables <envar>LC_CTYPE</envar> and + <envar>LC_COLLATE</envar> before running postmaster because + backend gets information about locale from environment. I use + following shell script: +<programlisting> +#!/bin/sh + +export LC_CTYPE=koi8-r +export LC_COLLATE=koi8-r +postmaster -B 1024 -S -D/usr/local/pgsql/data/ -o '-Fe' +</programlisting> + </para> + </listitem> + + <listitem> + <para> + Broken locale support in the operating system (for example, + locale support in libc under Linux several times has changed and + this caused a lot of problems). Perl has also support of locale + and if locale is broken <command>perl -v</> will complain + something like: +<screen> +8:17[mira]:~/WWW/postgres>setenv LC_CTYPE not_exist +8:18[mira]:~/WWW/postgres>perl -v +perl: warning: Setting locale failed. +perl: warning: Please check that your locale settings: +LC_ALL = (unset), +LC_CTYPE = "not_exist", +LANG = (unset) +are supported and installed on your system. +perl: warning: Falling back to the standard locale ("C"). +</screen> + </para> + </listitem> + + <listitem> + <para> + Wrong location of locale files. Possible locations include: + <filename>/usr/lib/locale</filename> (Linux, Solaris), + <filename>/usr/share/locale</filename> (Linux), + <filename>/usr/lib/nls/loc</filename> (DUX 4.0). + + Check <command>man locale</command> to find the correct + location. Under Linux I made a symbolic link between + <filename>/usr/lib/locale</filename> and + <filename>/usr/share/locale</filename> to be sure that the next + libc will not break my locale. + </para> + </listitem> + </itemizedlist> + </para> + + <formalpara> + <title>What are the Benefits?</title> + <para> + You can use ~* and order by operators for strings contain + characters from national alphabets. Non-english users definitely + need that. + </para> + </formalpara> + + <formalpara> + <title>What are the Drawbacks?</title> + <para> + There is one evident drawback of using locale - its speed! So, use + locale only if you really need it. + </para> + </formalpara> + </sect1> + + <sect1 id="postmaster-shutdown"> <title>Shutting down the server</title> |
