Re: [GENERAL] Very weird problem of "order by" in postgresql

2008-09-09 Thread Martijn van Oosterhout
On Tue, Sep 09, 2008 at 09:04:02AM +0800, Peter Cai wrote: > Oh, you are right! Although the 'locale' command show that the 2 has the > same locale settings. > The sort result of the same file is different. > Ubuntu is right, centos is wrong?? Note that glibc uses the information in /usr/shar

Re: [GENERAL] Very weird problem of "order by" in postgresql

2008-09-08 Thread Peter Cai
Oh, you are right! Although the 'locale' command show that the 2 has the same locale settings. The sort result of the same file is different. Ubuntu is right, centos is wrong…… Maybe I should as this question on some Linux mail lists or forums. Thanks a lot! On Mon, Sep 8, 2008 at 8:34 PM, Tom

Re: [GENERAL] Very weird problem of "order by" in postgresql

2008-09-08 Thread Tom Lane
"Peter Cai" <[EMAIL PROTECTED]> writes: > The only difference is that one OS is centos and the other is ubuntu It's hardly impossible that those two contain different locale definitions. Have you tried comparing the results of sort(1) under the same locale settings? regar

Re: [GENERAL] Very weird problem of "order by" in postgresql

2008-09-08 Thread Peter Cai
Here is my locale settings: LANG=zh_CN.UTF-8 LC_CTYPE="zh_CN.UTF-8" LC_NUMERIC="zh_CN.UTF-8" LC_TIME="zh_CN.UTF-8" LC_COLLATE="zh_CN.UTF-8" LC_MONETARY="zh_CN.UTF-8" LC_MESSAGES="zh_CN.UTF-8" LC_PAPER="zh_CN.UTF-8" LC_NAME="zh_CN.UTF-8" LC_ADDRESS="zh_CN.UTF-8" LC_TELEPHONE="zh_CN.UTF-8" LC_MEASUR

Re: [GENERAL] Very weird problem of "order by" in postgresql

2008-09-08 Thread Peter Cai
Still the same problem…… What I did is: 1. set locale to "zh_cn.UTF8" 2. reboot 3. use "locale" command to see if locale is set. 4. delete everything under /lib/var/pgsql/data to make sure the database will be completely re-initialed 5. restart postgresql I check pgstartup.log and I am sure the

Re: [GENERAL] Very weird problem of "order by" in postgresql

2008-09-07 Thread Justin Graf
Thisis the same problempostgresql has whendoing sorting when runonwindows vs. linux. Postgresql relies on the OS tohandlecollating aka sort orders. to Quote PostgreSQL uses the standard ISO C and POSIX locale facilities provided by the server operating system http://www.postgresql.org/docs

[GENERAL] Very weird problem of "order by" in postgresql

2008-09-07 Thread Peter Cai
Hi all, I have 2 postgresql running on linux on 2 different physical machines. Then I create 2 identical database on them, both using utf8 as server encoding and GBK as client encoding. But when I try to order by some query result with a column containing Chinese characters, the result is differ