Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 313BF4796D8 for ; Mon, 15 Apr 2002 13:45:14 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id C7BA9D60B; Mon, 15 Apr 2002 10:45:09 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id BD6D65C01; Mon, 15 Apr 2002 10:45:09 -0700 (PDT) Date: Mon, 15 Apr 2002 10:45:09 -0700 (PDT) From: Stephan Szabo To: jack Cc: , Josh Berkus Subject: Re: data order problem In-Reply-To: <001301c1e448$609a7cc0$1400a8c0@jac> Message-ID: <20020415082729.H27586-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200204/190 X-Sequence-Number: 7454 On Mon, 15 Apr 2002, jack wrote: > Hi, Jose > > Suppose '_' stands for a space character. The one column table,xxx, contains > following data. > column name is suburb and is set as primary key. > > 'THE_AAA' > 'THE_BBB' > 'THE_CDD' > 'THECCC' > > After I do > "SELECT * FROM xxx ORDER BY suburb;" > I've got this. > > 'THE_AAA' > 'THE_BBB' > 'THECCC' > 'THE_CDD' > > But I expect it should be like ... > 'THE_AAA' > 'THE_BBB' > 'THE_CDD' > 'THECCC' > > Because, according to ascii code, space character should be smaller than 'C' If you put the above data in a text file and use the sort command, I'd expect that you get the same ordering as postgres because the machine is probably not set to the 'C' locale, it's probably set to something like 'en_AU' which may have different sort order rules.