Re: Issue on Varchar Ordering - Mailing list pgsql-admin

From Peter Eisentraut
Subject Re: Issue on Varchar Ordering
Date
Msg-id 200608171503.48269.peter_e@gmx.net
Whole thread Raw
In response to Issue on Varchar Ordering  (Erika Terahata Torres Prada e Silva - MPS <erika.prada@previdencia.gov.br>)
List pgsql-admin
Erika Terahata Torres Prada e Silva - MPS wrote:
> I'm having the following issue:
>
> create table aluno (id serial, nome varchar(60));
>
> rodrigo=# select * from aluno order by nome offset 35 limit 5;
>  id |               nome
> ----+-----------------------------------
>  36 | GABRIELA HELEDA DE SOUZA
>  37 | GABRIELA JACOBY NOS
>  38 | GABRIEL ALCIDES KLIM PERONDI
>  39 | GABRIELA LETICIA BATISTA NUNES
>  40 | GABRIEL ALEXANDRE DA SILVA MANICA
> (5 registros)
>
> The problem is that records with id 38 and 40 might come before the
> others. It seems that the spacing isn't considered on ordering.

That is, for practical purposes, correct.

May I suggest that you properly normalize your tables, by putting given
name and family name into separate columns.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

pgsql-admin by date:

Previous
From: "guly"
Date:
Subject: unsubscribe
Next
From:
Date:
Subject: Monitoring error messages