Search Postgresql Archives

Re: COLLATE

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

 



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


[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