Re: Very weird problem of "order by" in postgresql

From: "Justin Graf" <justin(at)emproshunts(dot)com>
To: "Peter Cai" <newptcai(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Very weird problem of "order by" in postgresql
Date: 2008-09-08 04:39:24
Message-ID: 04392470703396@mail.emproshunts.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


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/8.3/interactive/locale.html

---- Message from mailto:newptcai(at)gmail(dot)com "Peter Cai" newptcai(at)gmail(dot)com at 09-08-2008 11:51:32 AM ------

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 different!!!!

One db return result in correct Chinese alphabet order but the other doesn't!

Is the problem of the configure of the operating system or the postgresql???

Thanks a lot!

PS : I read some solutions on this problem. It seems that many people met the same order by problem and have to convert the strings to "GBK" in there sql to get correct sorted result.
I don't think this is the correct solution.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2008-09-08 04:50:25 Re: varchar vs Text & TOAST
Previous Message Tom Lane 2008-09-08 04:06:50 Re: 64-bit Compile Failure on Solaris 10 with OpenSSL