unicode strings are not sorted alphabetically

Started by Volodymyr Kostyrkoalmost 22 years ago2 messagesbugs
Jump to latest
#1Volodymyr Kostyrko
arcade@ints.net

This applies to non-english strings (in my case - russian). I've
stumbled upon it on version 7.3.4. ( PostgreSQL 7.4.3 on
i386-portbld-freebsd5.2.1, compiled by GCC cc (GCC) 3.3.3 [FreeBSD]
20031106)

The attached files where created with:

pg_dump -U lib lib > database_dump
psql lib lib -c "select * from authors order by name" > result_of_query

The sorting order seem to be incorrect. Alpabetically they should be
sorted by 'id's as:

1
2
3
5
4
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

There's also another question on it. The russian alhabet differs from
ukrainian alphabet, so sorting should occur in different order. But the
order, provided by unicode charmap isn't good for any of them. This
probably applies to any Cyrillic charset.

--
[WBR], Arcade. [SAT Astronomy/Think to survive!]

Attachments:

database_dumptext/plain; name=database_dumpDownload
result_of_querytext/plain; name=result_of_queryDownload
#2Stephan Szabo
sszabo@megazone23.bigpanda.com
In reply to: Volodymyr Kostyrko (#1)
Re: unicode strings are not sorted alphabetically

On Sat, 31 Jul 2004, Volodymyr Kostyrko wrote:

This applies to non-english strings (in my case - russian). I've
stumbled upon it on version 7.3.4. ( PostgreSQL 7.4.3 on
i386-portbld-freebsd5.2.1, compiled by GCC cc (GCC) 3.3.3 [FreeBSD]
20031106)

What locale and server encoding was the server configured with?

I get a different result using -E UNICODE and ru_RU.UTF8 but still not in
id order, (2,1,3,5,4,6,7,8,9,13,10,11,12,16,14,17,18,15,19,20,21,22,23).
Do you get a different order from the unix sort command?