473,395 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Fw: Strange UNICODE sort order

Hi,

we're doing teste with UNICODE and Postgresql 7.4.2.

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?

TIA,
Ricardo.


Nov 23 '05 #1
1 1627

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
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

39
by: Erlend Fuglum | last post by:
Hi everyone, I'm having some trouble sorting lists. I suspect this might have something to do with locale settings and/or character encoding/unicode. Consider the following example, text...
8
by: Eric Lilja | last post by:
Hello, I had what I thought was normal text-file and I needed to locate a string matching a certain pattern in that file and, if found, replace that string. I thought this would be simple but I had...
15
by: | last post by:
The data file is a simple Unicode file with lines of text. BCP apparently doesn't guarantee this ordering, and neither does the import tool. I want to be able to load the data either sequentially...
6
by: peter pilsl | last post by:
postgres 7.3.2 I store unicode-data in postgresql. The data is retrieved via webinterfaces, processed with perl and then stored in postgresql (and viceversa). All is going nice with one...
4
by: Eric E | last post by:
Hi all, I have a fairly complex form in Access 2000. In particular, it has two subforms on separate tabs of a tab control. For the last two weeks, I've encountered the dreaded : "You can't...
6
by: John Sidney-Woollett | last post by:
Hi I need to store accented characters in a postgres (7.4) database, and access the data (mostly) using the postgres JDBC driver (from a web app). Does anyone know if: 1) Is there a...
6
by: Dennis Gearon | last post by:
This is what has to be eventually done:(as sybase, and probably others do it) http://www.ianywhere.com/whitepapers/unicode.html I'm not sure how that will affect LIKE and REGEX. ...
2
by: escher4096 | last post by:
Hi all, In C# 2.0, if I take a set of strings and toss them into an ArrayList and then sort them it does not always work as expected. I used some garbage data (I just grabbed the using...
17
by: Adam Olsen | last post by:
As was seen in another thread, there's a great deal of confusion with regard to surrogates. Most programmers assume Python's unicode type exposes only complete characters. Even CPython's own...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.