Re: RES: RES: Issue on Varchar Ordering

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Erika Terahata Torres Prada e Silva - MPS <erika(dot)prada(at)previdencia(dot)gov(dot)br>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: RES: RES: Issue on Varchar Ordering
Date: 2006-08-17 21:32:06
Message-ID: 20060817213206.GF318@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Erika Terahata Torres Prada e Silva - MPS wrote:
>
> Thanks everybody.
>
>
> The correct order in Portuguese would return as brazilian telephone guide
> order as below:
>
> select * from aluno order by nome
> id nome
> 38 GABRIEL ALCIDES KLIM PERONDI
> 40 GABRIEL ALEXANDRE DA SILVA MANICA
> 36 GABRIELA HELEDA DE SOUZA
> 37 GABRIELA JACOBY NOS
> 39 GABRIELA LETICIA BATISTA NUNES
>
> Indeed using POSIX, C, the result above is Ok, but it doesn't work for me
> because of the accented and special characters.

I stand corrected -- that is the sort order returned by sort under the
pt_BR locale (which is indeed different from the spanish sort order).

What's your lc_collate setting? What does this return on your system?

LC_COLLATE=pt_PT sort << EOF
GABRIEL ALEXANDRE DA SILVA MANICA
GABRIELA JACOBY NOS
GABRIELA HELEDA DE SOUZA
GABRIELA LETICIA BATISTA NUNES
GABRIEL ALCIDES KLIM PERONDI
EOF

On my system it outputs the order you show above, which shows that my
locale is correctly defined per your expectations.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tomeh, Husam 2006-08-17 22:42:45 LOG: could not receive data from client: Connection reset by peer
Previous Message Erika Terahata Torres Prada e Silva - MPS 2006-08-17 21:05:53 RES: RES: Issue on Varchar Ordering