How to setup a good collation? - Mailing list pgsql-admin

From Nagy László Zsolt
Subject How to setup a good collation?
Date
Msg-id 56DBF4B7.1050200@shopzeus.com
Whole thread Raw
Responses Re: How to setup a good collation?  (Nagy László Zsolt <gandalf@shopzeus.com>)
List pgsql-admin
Example database on a Unix system:

CREATE DATABASE test
       TEMPLATE = template0
       ENCODING = 'UTF8'
       LC_COLLATE = 'hu_HU.UTF-8'
       LC_CTYPE = 'hu_HU.UTF-8'
       CONNECTION LIMIT = -1;
\c test
create table a (name text collate "hu_HU.UTF-8");
insert into a values ('a');
insert into a values ('á');
insert into a values ('Á');
insert into a values ('b');
insert into a values ('e');
insert into a values ('é');
insert into a values ('É');
insert into a values ('o');
insert into a values ('ó');
insert into a values ('ö');
insert into a values ('U');
insert into a values ('Ü');
insert into a values ('Z');


select name from a order by upper(name) asc;


Results in:

"a"
"b"
"e"
"o"
"U"
"Z"
"á"
"Á"
"é"
"É"
"ó"
"ö"
"Ü"

Which is bad. The good order should be the following:

"a"
"á"
"Á"
"b"
"e"
"é"
"É"
"o"
"ó"
"ö"
"U"
"Ü"
"Z"

What is wrong with my collaction setup?

Thanks,

   Laszlo



pgsql-admin by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: Getting OOM errors from PostgreSQL
Next
From: Nagy László Zsolt
Date:
Subject: Re: How to setup a good collation?