On Sat, 17 Nov 2001, Tom Lane wrote:
> Palle Girgensohn <girgen@partitur.se> writes:
> > My need is really to get different sorting on *the same* column, depending
> > on which locale the present user prefers.
> > ... I guess this is not even supported by the SQL standard, or
> > any other RDBMS for that matter, right?
>
> I believe SQL regards the locale as essentially a property of a
> datatype, which means that in theory you should be able to cast a column
> value to type text-with-locale-X and then ORDER BY that. It'd be an
> on-the-fly sort, not able to exploit any indexes, but it sounds like
> that's acceptable to you.
Would it be possible to make a function in plpgsql or whatever that
wrapped the collate changes and then order by that and make functional
indexes? Would the system use it?