Order By and Comparisson

From: "howardnews(at)selestial(dot)com" <howardnews(at)selestial(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Order By and Comparisson
Date: 2014-04-07 10:04:23
Message-ID: 53427827.3090207@selestial.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

just as I thought I had postgres mastered :) the ordering of strings is
causing me some confusion.

Can someone explain how the database orders strings in the ORDER BY command.

My example:

My database is encoding is UTF-8, and default language is english,

If I have a text column in a table with the following rows:

'a'
'A'
'~'

Then in UTF-8, I would expect the order to give me

'A'
'a'
'~'

But instead I get:

'~'
'a'
'A'

Is there anywhere in the documentation I can get a more detailed
explanation of this?

Thanks.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2014-04-07 10:58:12 Re: Order By and Comparisson
Previous Message Albe Laurenz 2014-04-07 09:50:16 Re: Initial queries of day slow