Re: Fw: Strange UNICODE sort order - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Fw: Strange UNICODE sort order
Date
Msg-id 20040819145900.J60006@megazone.bigpanda.com
Whole thread Raw
In response to Fw: Strange UNICODE sort order  ("INSYDE - lists" <insyde09@terra.com.br>)
List 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


pgsql-general by date:

Previous
From: snpe
Date:
Subject: Re: Postgresql feature
Next
From: Thomas Hallgren
Date:
Subject: Re: PostgreSQL 8.0 Feature List?