Re: cyrillic and sort order (ORDER BY)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mihail Marinov <liahim(at)bcci(dot)bg>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: cyrillic and sort order (ORDER BY)
Date: 2001-01-02 23:38:30
Message-ID: 14295.978478710@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Peter Eisentraut <peter_e(at)gmx(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message GH 2001-01-02 23:53:26 Re: RE: Re: MySQL and PostgreSQL speed compare
Previous Message Thomas T. Thai 2001-01-02 23:08:17 baseconvert