pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nagy László Zsolt <gandalf@shopzeus.com>
To: pgsql-admin@postgresql.org
Subject: How to setup a good collation?
Date: Sun, 6 Mar 2016 10:13:27 +0100
Message-ID: <56DBF4B7.1050200@shopzeus.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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



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



view thread (5+ messages)  latest in thread

Message-ID: <56DBF4B7.1050200@shopzeus.com>
Permalink:  ../56DBF4B7.1050200@shopzeus.com/
Also on:    postgresql.org/message-id/56DBF4B7.1050200@shopzeus.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: gandalf@shopzeus.com
  Subject: Re: How to setup a good collation?
  In-Reply-To: <56DBF4B7.1050200@shopzeus.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox