Unix Technical Forum

problem with nasty latin2 sorting

This is a discussion on problem with nasty latin2 sorting within the pgsql Hackers forums, part of the PostgreSQL category; --> Hello, I've got a problem with sorting polish words in postgresql 7.4.2 For example, I've got couple of polish ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-11-2008, 07:24 AM
Anna Domachowska
 
Posts: n/a
Default problem with nasty latin2 sorting

Hello,
I've got a problem with sorting polish words in postgresql 7.4.2

For example, I've got couple of polish cities in my table 'x', results
of sorting are:
(select city from x order by city asc)

Bydgoszcz
Gdańsk
Iława
Łódź
Żarnów
Malbork
Warszawa

So "Żarnów" is placed in wrong place, because it should be found after
letter "Z" ??

What's wrong? Is there any patch to fix this? Does anybody had similar
problem?
I belive that postgres was compiled with "--enable-locale", and the
right locale is set.

Anna Domachowska

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-11-2008, 07:25 AM
Greg Stark
 
Posts: n/a
Default Re: problem with nasty latin2 sorting


Anna Domachowska <anka@zjednoczenie.com> writes:

> So "Żarnów" is placed in wrong place, because it should be found after letter
> "Z" ??
>
> What's wrong? Is there any patch to fix this? Does anybody had similar problem?
> I belive that postgres was compiled with "--enable-locale", and the right
> locale is set.


What does "show lc_collate" say?
What does \l show in psql?

what do you get on your machine if you save that same list in a file and run
"sort" on it on the commandline set (with LC_COLLATE set to the same value as
above)?

--
greg


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-11-2008, 07:25 AM
Tom Lane
 
Posts: n/a
Default Re: problem with nasty latin2 sorting

Anna Domachowska <anka@zjednoczenie.com> writes:
> I've got a problem with sorting polish words in postgresql 7.4.2
> ...
> I belive that postgres was compiled with "--enable-locale", and the
> right locale is set.


How sure are you of that? This sure sounds like a wrong-locale problem
to me. Try "show lc_collate" and "show server_encoding".

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:11 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com