Thread: Re: problem with nasty latin2 sorting

Re: problem with nasty latin2 sorting

From
Volkan YAZICI
Date:
On Dec 21 11:01, Anna Domachowska wrote:
> 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.

Beside previous suggestions, I'm curious about your libc version too.
PostgreSQL relies on system locale while making character related
processes - like case conversion, collation and etc. Does below
command set succeed in sorting above data:

  $ export LC_COLLATE=<related_locale>
  $ cat >/tmp/test.out <<EOF
  > Bydgoszcz
  > Gda...
  > ...
  > EOF
  $ sort /tmp/test.out

If above command set doesn't succeed, this means your problem is with
libc. Otherwise, as mentioned in the previous posts, please check your
database encoding.


Regards.

--
"We are the middle children of history, raised by television to believe
that someday we'll be millionaires and movie stars and rock stars, but
we won't. And we're just learning this fact," Tyler said. "So don't
fuck with us."