Arbitrary collation support for PostgreSQL - Mailing list pgsql-hackers

From Honza Pazdziora
Subject Arbitrary collation support for PostgreSQL
Date
Msg-id 20040226083939.GC1680@anxur.fi.muni.cz
Whole thread Raw
List pgsql-hackers
Hello all,

PostgreSQL, at least until version 7.4, has rather weak support for
various collating sequences. What you get when you do
select * from table order by column

is hardcoded in the database cluster at the initdb time. Yet, it is
reasonable request to want one select to order by using English rules,
another one to run with German rules and yet another with Czech ones,
without having to dump, initdb, restore.

The distribution

http://www.fi.muni.cz/~adelton/l10n/postgresql-nls-string-0.50.tar.gz

defines a function nls_string which allows collation to be set at
runtime:
select * from table order by nls_string(name, 'en_US.UTF-8')select * from table order by nls_string(name,
'cs_CZ.UTF-8')select* from table order by nls_string(name, 'C')
 

The README and INSTALL files with more details are included in the
distribution.

I'd appreciate comments about the viability of the goal, name,
and / or solution presented.

Yours,

-- 
------------------------------------------------------------------------Honza Pazdziora | adelton@fi.muni.cz |
http://www.fi.muni.cz/~adelton/.project:Perl, mod_perl, DBI, Oracle, large Web systems, XML/XSL, ...    Only
self-confidentpeople can be simple.
 


pgsql-hackers by date:

Previous
From: hornyakl@inf.elte.hu (HORNYAK Laszlo)
Date:
Subject: Re: Pl/Java - next step?
Next
From: eddy.kalem@edusoft.com (ElPeddy)
Date:
Subject: Re: RFC: Very large scale postgres support