Re: Encoding problem with 7.4

Поиск
Список
Период
Сортировка
От E.Rodichev
Тема Re: Encoding problem with 7.4
Дата
Msg-id Pine.GSO.4.58.0312041700150.27985@ra.sai.msu.su
обсуждение исходный текст
Ответ на Re: Encoding problem with 7.4  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Ответы Re: Encoding problem with 7.4  (Andrew Dunstan <andrew@dunslane.net>)
Re: Encoding problem with 7.4  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-hackers
On Wed, 3 Dec 2003, Stephan Szabo wrote:

> The locale settings depend on LC_* at initdb time only. When the
> postmaster starts it sets the locale based on the stored values from
> initdb, not on the current environment.
>
> With an SQL_ASCII database being accessed from a client with
> client_encoding set to SQL_ASCII (which it should be if you aren't setting
> it) the byte values of a string are passed along with no conversion for
> the encoding.  This means that from within one environment you should get
> back what you put in, so it might *look* like it's KOI8-R if that's what
> you're in, but it's not because someone accessing it from say an ISO8859-1
> system may see something different.

As a result, the possibility to control encodings and locales looks as
follows:
           initdb   createdb     psql
Encoding:      Y         Y          Y
Locale:        Y         N          N

It seems that more natural scheme will be
           initdb   createdb     psql
Encoding:      Y         Y          Y
Locale:        Y         Y          Y

Now the possibility to use different encodings for createdb and psql is
a bit strange... Also, it is impossible to have different locales
for different databases within one cluster, and it is impossible to use
different locales with one database. The latter is even more critical.
The reason is that the sorting under C locale is much more effective compared with
one under another locales (10-50 times faster for some implementations!).
Another reason is that for some applications it is _necessary_ to use different
sort order for different tables. For example, I may have two tables:
russian_persons and forein_persons, and i'd like to print the sorted list
of persons. The russian_persons names must be sorted with ru_RU.KOI8-R locale,
and the forein_persons - with C locale.

Best wishes,
E.R.
_________________________________________________________________________
Evgeny Rodichev                          Sternberg Astronomical Institute
email: er@sai.msu.su                              Moscow State University
Phone: 007 (095) 939 2383
Fax:   007 (095) 932 8841                       http://www.sai.msu.su/~er


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Doug McNaught
Дата:
Сообщение: Re: PostgreSQL 7.3.4 gets killed by SIG_KILL
Следующее
От: Joe Conway
Дата:
Сообщение: Re: request for feedback - read-only GUC variables,