Re: cyrillic and sort order (ORDER BY) - Mailing list pgsql-general

From Tom Lane
Subject Re: cyrillic and sort order (ORDER BY)
Date
Msg-id 14295.978478710@sss.pgh.pa.us
Whole thread Raw
In response to Re: cyrillic and sort order (ORDER BY)  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re[2]: cyrillic and sort order (ORDER BY)  (Mihail Marinov <liahim@bcci.bg>)
Re: cyrillic and sort order (ORDER BY)  (Radoslaw Stachowiak <radek@alter.pl>)
List 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 by date:

Previous
From: GH
Date:
Subject: Re: RE: Re: MySQL and PostgreSQL speed compare
Next
From: Jan Wieck
Date:
Subject: Re: Re: Failed Statements within Transactions