[CentOS] Re: Problem of "sort" utf8 file.

Peter Cai newptcai at gmail.com
Tue Sep 9 07:14:29 UTC 2008


I already did that.

The problem is not that the locale is not correct,  but even if it's
correct, the sort order is wrong.
The result provided by pg is the same as the "sort" command.
It shows that pg use OS's facility to sort string.

Someone told me it's a bug of glibc.  So I checked it and found that
ubuntu use glibc 2.7 while centos5 use glibc 2.5.
That maybe the problem.

But updating glibc is too hard for me.  Maybe I have to give up.

On Tue, Sep 9, 2008 at 3:05 PM, Tom G. Christensen
<tgc at statsbiblioteket.dk> wrote:
> Peter Cai wrote:
>>
>> PS: the background of this problem is that Postgresql's "order by"
>> command depends on the sort result of the OS.
>>
> AFAIK PostgreSQL will determine its own locale from the system locale when
> it's initdb'ed for the first time, that locale will then be used for all
> databases even if you later change the system locale.
> Perhaps you need to dump your databases and do a new initdb with the proper
> locale set before this starts working the way you want.
>
> -tgc
>
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>



-- 
科幻小说可能在哲学上是天真的,在道德上是简单的,在美学上是有些主观的,或粗糙的,但是就它最好的方面而言,它似乎触及了人类集体梦想的神经中枢,解放出我们人类这具机器中深藏的某些幻想。


More information about the CentOS mailing list