Re: COLLATE

From: Jan Behrens <jan(dot)behrens(at)flexiguided(dot)de>
To: Filip Rembiałkowski <plk(dot)zuber(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: COLLATE
Date: 2006-06-14 12:51:31
Message-ID: 44900653.9040306@flexiguided.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Filip Rembiałkowski wrote:
> let's assume that we keep Unicode text data in the column.
> sometimes we want to sort it according to specific collation order.
> how can we force collation when running a query?

Hi Filip,

I had the same problem you have. As a solution I implemented a wrapper
function named collkey(), which transforms a Unicode string into a
sortable collation key using IBM's ICU library. Of course it's not as
nice as having a standard SQL command for it, but i think it's a nice
solution, until a good collation support is provided by PostgreSQL itself.

You can find the source here:
http://www.flexiguided.de/publications.pgcollkey.en.html

I can understand that people don't want PostgreSQL being dependent of
other libraries. The best solution for future would be implementing
independent collation functions inside of PostgreSQL, which also support
standard SQL syntax, but that's a lot of work, i think.

Jan Behrens

In response to

  • COLLATE at 2006-06-05 15:04:25 from Filip Rembiałkowski

Browse pgsql-general by date

  From Date Subject
Next Message Guido Neitzer 2006-06-14 13:06:25 Re: Copy content from dbs
Previous Message A. Kretschmer 2006-06-14 12:12:44 Re: Copy content from dbs