Re: unexpected (to me) sorting order

Поиск
Список
Период
Сортировка
От Alberto Cabello Sánchez
Тема Re: unexpected (to me) sorting order
Дата
Msg-id 20150408115616.0414b63cf88f430139c35187@unex.es
обсуждение исходный текст
Ответ на Re: unexpected (to me) sorting order  (Chris Mair <chris@1006.org>)
Список pgsql-general
On Wed, 08 Apr 2015 11:36:01 +0200
Chris Mair <chris@1006.org> 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@unex.es>


В списке pgsql-general по дате отправления:

Предыдущее
От: Björn Lundin
Дата:
Сообщение: Re: unexpected (to me) sorting order
Следующее
От: Filipe Pina
Дата:
Сообщение: Re: Serializable transaction restart/re-execute