Re: BUG #1082: Order by doesn't sort correctly. - Mailing list pgsql-bugs

From Richard Neill
Subject Re: BUG #1082: Order by doesn't sort correctly.
Date
Msg-id 4037E70D.6020106@hermes.cam.ac.uk
Whole thread Raw
In response to Re: BUG #1082: Order by doesn't sort correctly.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Tom Lane wrote:
> "PostgreSQL Bugs List" <pgsql-bugs@postgresql.org> writes:
>
>>Description:        Order by doesn't sort correctly.
>
>
> It almost certainly is the correct sort order according to the locale
> you're using.  Use pg_controldata to check the database locale.  You'll
> probably want to re-initdb in C locale.  Most non-C locales have weird
> rules that try to approximate dictionary sort order.
>
>             regards, tom lane
>

Dear Tom,

Thanks for your email. I did check pg_controldata and found:
LC_COLLATE:  en_GB
LC_CTYPE:    en_GB

The bug isn't the particular ascii-betical (or other) order.
But what I am getting as a supposedly ordered list includes:

Cymbal #1
Cymbal - 18 inch
Cymbal #2

This ordering is perverse! No matter what the priority is of the
different characters, I cannot understand how the above can arise.
Whether '#' comes before or after '-', '#1' and '#2' should be adjacent.

Richard

pgsql-bugs by date:

Previous
From: Richard Neill
Date:
Subject: Re: BUG #1082: Order by doesn't sort correctly.
Next
From: Stephan Szabo
Date:
Subject: Re: The syntax about CREATE DOMAIN