Re: cyrillic and sort order (ORDER BY)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: cyrillic and sort order (ORDER BY)
Дата
Msg-id 14295.978478710@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: cyrillic and sort order (ORDER BY)  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re[2]: cyrillic and sort order (ORDER BY)
Re: cyrillic and sort order (ORDER BY)
Список pgsql-general
Peter Eisentraut <peter_e@gmx.net> writes:
> Mihail Marinov writes:
>> My problem is that ORDER BY does not alphabetically order strings in
>> proper way. Worst - it does sometimes work right but I can't find out
>> exactly why. But after a while it stops until I rebuild and
>> reconfigure.

> You must have the same collation locale setting (LC_COLLATE, or LC_ALL as
> default) when running initdb and when running postmaster.  Changing the
> setting in between will result in random and incorrect results and
> database corruption.

To enlarge a little more: the most common way to get burnt by this is
to have different LC_xxx environment variables when starting the
postmaster from a boot script as you do when running initdb or starting
the postmaster from an interactive shell.  Best to explicitly set the
desired locale in the script that fires up the postmaster.

Postgres 7.1 solves this problem by locking down a database's locale at
initdb time.  Subsequent postmaster runs will adopt the LC_COLLATE value
that was prevalent when initdb ran, no matter what their environment is.

            regards, tom lane

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

Предыдущее
От: GH
Дата:
Сообщение: Re: RE: Re: MySQL and PostgreSQL speed compare
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: Re: Failed Statements within Transactions