Re: COLLATE - Mailing list pgsql-general

From Jan Behrens
Subject Re: COLLATE
Date
Msg-id 44900653.9040306@flexiguided.de
Whole thread Raw
In response to COLLATE  ("Filip Rembiałkowski" <plk.zuber@gmail.com>)
List 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

pgsql-general by date:

Previous
From: Guido Neitzer
Date:
Subject: Re: Copy content from dbs
Next
From: Tom Lane
Date:
Subject: Re: Partitioning...