Search Postgresql Archives

Re: unexpected (to me) sorting order

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 08 Apr 2015 11:36:01 +0200
Chris Mair <chris@xxxxxxxx> wrote:

> PostreSQL relies on the OS's C lib. So this kind
> of ordering problems depend on the OS' idea about
> collations.
> 
> I don't know what's the rationale behin this,
> but it looks like Linux ignores the . when doing the sort.

Not only '.'. Sorting by VARCHAR is not ASCII order, but "alphabetical" (whatever
it means), which causes some behaviour to be more real-life oriented than
logically coherent, like this one:


select * from ejemplo order by texto;

 id |  texto   
----+----------
  2 | Lalin
  1 | La Palma
  3 | Lasarte


It is pretty obvious that ' ' is not between 'l' and 's', but this makes more
sense than 

  1 | La Palma
  2 | Lalin
  3 | Lasarte


-- 
Alberto Cabello Sánchez
<alberto@xxxxxxx>


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux