Search Postgresql Archives

Collation in ORDER BY not lexicographical

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

We have big problems with collation in ORDER BY, which happens in binary order, not alphabetic (lexicographical), like:.

A
B
Z
a
z
Ä
Ö
ä
ö

This is what we have done:

1. initdb -U myuser -E UTF-8 --locale=de_DE.UTF-8 -D /mydata

2. pg_ctl -U myuser -D /mydata -l logfile start

3. createdb -U myuser mydb

4. create table mytable(name text)

5.  insert into mytable values('Adam'); ....

6. select * from mytable order by name

The result is:

"Adam"
"Berta"
"Mann"
"Zoo"
"Zoodirektor"
"adam"
"Äpfel"
"Öl"
"äpfel"

"locale -a" shows:

de_DE
de_DE.ISO8859-1
de_DE.ISO8859-15
de_DE.UTF-8

"psql -l" shows:

                                           List of databases
Name | Owner | Encoding | Collation | Ctype | Access privileges ----------+-----------+----------+-------------+------------- +-----------------------------------
 postgres  | myuser | UTF8     | de_DE.UTF-8 | de_DE.UTF-8 |
 template0 | myuser | UTF8     | de_DE.UTF-8 | de_DE.UTF-8 | =c/myuser
: myuser =CTc/myuser
 template1 | myuser | UTF8     | de_DE.UTF-8 | de_DE.UTF-8 | =c/myuser
: myuser =CTc/myuser
 mydb      | myuser | UTF8     | de_DE.UTF-8 | de_DE.UTF-8 |

PG is running on Mac OS X 10.5 and 10.6 Intel.


Any help is appreciated. Thanks very much in advance.

Paul
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux