Re: order by question - Mailing list pgsql-general

From Adrian Klaver
Subject Re: order by question
Date
Msg-id 53E3A506.3090805@aklaver.com
Whole thread Raw
In response to Re: order by question  (Kevin Grittner <kgrittn@ymail.com>)
Responses Re: order by question  (Steve Clark <sclark@netwolves.com>)
List pgsql-general
On 08/07/2014 08:53 AM, Steve Clark wrote:
> On 08/07/2014 11:36 AM, Kevin Grittner wrote:
>> Steve Clark <sclark@netwolves.com> wrote:
>>

>>
>> --
>> Kevin Grittner
>> EDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
> Hi Kevin,
>
> Thanks for the response. I get the same thing as postgres if I sort from
> the command line too. But I don't understand why.

Because that is how en_US.UTF-8 sorts. You are probably looking for the
'C' sort order. For more explanations see:

http://rhaas.blogspot.com/2012/03/perils-of-collation-aware-comparisons.html

http://superuser.com/questions/227925/in-utf-8-collation-why-11-is-less-then-1

>
> I would expect '-F' to sort immediately after '-' and '--' not after 'F' as
> well as ' Feneric' (spaceFeneric) and ' Generic' (spaceGeneric) to sort
> immediately after ' ' (space).
>
> It is like the space character and the - in -Letter is ignored.

See the second link above for why that is.

>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


pgsql-general by date:

Previous
From: Paul Jungwirth
Date:
Subject: Re: Recursive CTE trees + Sorting by votes
Next
From: Kevin Grittner
Date:
Subject: Re: order by question