Re: data order problem

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: jack <datactrl(at)tpg(dot)com(dot)au>
Cc: <pgsql-sql(at)postgresql(dot)org>, Josh Berkus <josh(at)agliodbs(dot)com>
Subject: Re: data order problem
Date: 2002-04-15 17:45:09
Message-ID: 20020415082729.H27586-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice pgsql-sql

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.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Bjarte Aagnes 2002-04-15 18:38:12 MAX(column1),MAX(column2),...
Previous Message Tom Lane 2002-04-15 17:44:23 Re: SQL-Dump and refertial Integrity

Browse pgsql-sql by date

  From Date Subject
Next Message Bjarte Aagnes 2002-04-15 18:38:12 MAX(column1),MAX(column2),...
Previous Message Edipo Elder Fernandes de Melo 2002-04-15 17:38:05 Large or Small tables?