RES: Order by behaviour

From: "Carlos H(dot) Reimer" <carlos(dot)reimer(at)opendb(dot)com(dot)br>
To: "Stephan Szabo" <sszabo(at)megazone(dot)bigpanda(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: RES: Order by behaviour
Date: 2007-04-05 21:46:27
Message-ID: PEEPKDFEHHEMKBBFPOOKMELCEFAA.carlos.reimer@opendb.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I was trying to find the docs about the collating sequence standards but
could not find.

Would like to know for example which characters are ignored by the "order
by" in some of the collating types.

Please, can anyone indicate me where could I find documentation about these
standards?

Thanks in advance!

> -----Mensagem original-----
> De: Stephan Szabo [mailto:sszabo(at)megazone(dot)bigpanda(dot)com]
> Enviada em: quarta-feira, 28 de março de 2007 19:23
> Para: Carlos H. Reimer
> Cc: pgsql-general(at)postgresql(dot)org
> Assunto: Re: [GENERAL] Order by behaviour
>
>
> On Wed, 28 Mar 2007, Carlos H. Reimer wrote:
>
> > Hi,
> >
> > We have a PostgreSQL 8.0.6 cluster configured with
> lc_collate=pt_BR.UTF-8
> > and when we run the following SELECT:
> > SELECT substr(nomerazao,1,4),
> > ascii(substr(nomerazao,1,1)),
> > ascii(substr(nomerazao,2,1))
> > from spunico.unico order by nomerazao;
> >
> > is returning:
> >
> > substr | ascii | ascii
> > --------+-------+-------
> > | 32 | 0
> > | 32 | 0
> > 1000 | 49 | 48
> > 1.DI | 49 | 46
> > 1° R | 49 | 176
> > 2M C | 50 | 77
> > 3A.G | 51 | 65
> > A. A | 65 | 46
> > AABA | 65 | 65
> > A.A. | 65 | 46
> > A.AG | 65 | 46
> > A.A. | 65 | 46
> > A.A. | 65 | 46
> > ABAS | 65 | 66
> > ABAS | 65 | 66
> > ABAT | 65 | 66
> > A.B. | 65 | 46
> > A.B. | 65 | 46
> > ABCC | 65 | 66
> > A.B. | 65 | 46
> > A.B. | 65 | 46
> >
> > Are not the lines out of order or is it a normal behaviour for
> a server with
> > lc_collate=pt_BR.UTF-8?
>
> Many collations ignore spaces and symbols on the first pass, so, for
> example you might have "A Z" > "AB" despite the fact that a space has a
> lower value than a B.
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message William Garrison 2007-04-05 22:22:52 Re: Storing blobs in PG DB
Previous Message Alvaro Herrera 2007-04-05 21:46:11 Re: Seg fault in pg_dump?