Re: Multilingual application, ORDER BY w/ different locales? - Mailing list pgsql-hackers

From Stephan Szabo
Subject Re: Multilingual application, ORDER BY w/ different locales?
Date
Msg-id 20011117131146.I31141-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: Multilingual application, ORDER BY w/ different locales?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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?



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Multilingual application, ORDER BY w/ different locales?
Next
From: Stephan Szabo
Date:
Subject: Re: Multilingual application, ORDER BY w/ different locales?