Skip site navigation (1) Skip section navigation (2)

Re: Fw: Strange UNICODE sort order

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: INSYDE - lists <insyde09(at)terra(dot)com(dot)br>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Fw: Strange UNICODE sort order
Date: 2004-08-19 22:01:26
Message-ID: 20040819145900.J60006@megazone.bigpanda.com (view raw or flat)
Thread:
Lists: pgsql-general
On Thu, 19 Aug 2004, INSYDE - lists wrote:

> we're doing teste with UNICODE and Postgresql 7.4.2.

Ordering is defined by the locale you're in.  What locale are
you using?

>
> After insert some data we do a select like:
>
> select * from my_tbl_01 order by field_01
>
> Its results is totally misdone like:
>
> _
> -
> (
> A
> O
> O_
> O-
> O(
> OA
> O A
> O_A
> O-A
> O(A
> OAA
> OAAR
> OAARG
> OAARGU
> O AR
> O_AR
> O-AR
> O(AR
> O ARG
> O_ARG
> O-ARG
> O(ARG
>
> Why don't Postgresql order it by clustering all the characters
> that are equal, instead of sorting by the size of the string?

It looks to me that you're probably in some "natural language" locale
that ignores spaces and symbols in its first pass, thus, the first pass
looks like:
<empty>
<empty>
<empty>
A
O
O
O
O
OA
OA
OA
OA
OA
OAA
OAAR
OAARG
OAARGU
OAR
OAR
OAR
OAR
OARG
OARG
OARG
OARG


In response to

pgsql-general by date

Next:From: snpeDate: 2004-08-20 00:19:55
Subject: Re: Postgresql feature
Previous:From: INSYDE - listsDate: 2004-08-19 21:45:22
Subject: Fw: Strange UNICODE sort order

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group