Thread: BUG #6244: Ordering Problem

BUG #6244: Ordering Problem

From
"Murilo Lobato"
Date:
The following bug has been logged online:

Bug reference:      6244
Logged by:          Murilo Lobato
Email address:      murilo@perfilweb.com.br
PostgreSQL version: 9.0.3
Operating system:   Centos 5.5
Description:        Ordering Problem
Details:

We have a clients table, and when we run a select on the table ordering by
name we get unexpected results. The whitespaces on the string are not being
computed, as follown:

what is happening:
 1 - Lucia Amaral
 2 - Luci Martins

What we expecting:
 1 - Luci Martins
 2 - Lucia Amaral

Resuming, the whitespace is being ignored during the order.

Re: BUG #6244: Ordering Problem

From
Merlin Moncure
Date:
On Fri, Oct 7, 2011 at 8:31 AM, Murilo Lobato <murilo@perfilweb.com.br> wro=
te:
>
> The following bug has been logged online:
>
> Bug reference: =A0 =A0 =A06244
> Logged by: =A0 =A0 =A0 =A0 =A0Murilo Lobato
> Email address: =A0 =A0 =A0murilo@perfilweb.com.br
> PostgreSQL version: 9.0.3
> Operating system: =A0 Centos 5.5
> Description: =A0 =A0 =A0 =A0Ordering Problem
> Details:
>
> We have a clients table, and when we run a select on the table ordering by
> name we get unexpected results. The whitespaces on the string are not bei=
ng
> computed, as follown:
>
> what is happening:
> =A01 - Lucia Amaral
> =A02 - Luci Martins
>
> What we expecting:
> =A01 - Luci Martins
> =A02 - Lucia Amaral
>
> Resuming, the whitespace is being ignored during the order.

problems like this are usually encoding/locale related.  what's
database encoding, and what's database lc_collate?

merlin

Re: BUG #6244: Ordering Problem

From
Merlin Moncure
Date:
On Mon, Oct 10, 2011 at 7:35 AM, Murilo - Perfilweb Inform=E1tica
<murilo@perfilweb.com.br> wrote:
> Hello,
> My encoding is LATIN1, my collation is pt_BR
> Thank You.
> 2011/10/7 Merlin Moncure <mmoncure@gmail.com>

hm, LATIN1 is not a unicode supporting encoding, that might be
problem.  your database should probably be defined UTF8.  not an
expert in encodings though...anyone else care to comment?  (also, try
not to top-post and be sure to cc the list).

merlin

Re: BUG #6244: Ordering Problem

From
Leandro Guimarães Faria Corce DUTRA
Date:
Le 2011-O-11  18h57, Merlin Moncure a écrit :
>
> hm, LATIN1 is not a unicode supporting encoding, that might be
> problem.  your database should probably be defined UTF8.

Precisely, Latin1 is obsolete.  Latin9 is better, as it at least
includes the Euro character €, but still not as good as UTF-8.


> expert in encodings though...anyone else care to comment?  (also, try
> not to top-post and be sure to cc the list).

Better yet, this is discussed almost every week in
pgbr-geral@postgresql.org.br



--
skype:leandro.gfc.dutra?chat      Yahoo!: ymsgr:sendIM?lgcdutra
+55 (61) 3546 7191              gTalk: xmpp:leandrod@jabber.org
+55 (11) 9406 7191        ICQ/AIM: aim:GoIM?screenname=61287803
BRAZIL GMT-3  MSN: msnim:chat?contact=leandro@dutra.fastmail.fm