Re: ORDER BY different locales - Mailing list pgsql-hackers

From Karel Zak
Subject Re: ORDER BY different locales
Date
Msg-id 20040226144543.GC9785@zf.jcu.cz
Whole thread Raw
In response to Re: ORDER BY different locales  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, Feb 26, 2004 at 09:16:03AM -0500, Tom Lane wrote:
> Karel Zak <zakkr@zf.jcu.cz> writes:
> >  I  think possible  solution is  special function  used ORDER  BY clause
> >  which knows to switch by safe  way to wanted locales, convert string by
> >  strxfrm() and switch back to backend locales.
> 
> This function breaks the whole backend if an elog() failure occurs while
I  don't think  so. There  is setlocale()  to  original locales  beforeelog(). But important  is idea of  this
function.We can rewrite  it tofix some minor problems...
 

> it's got the wrong locale set.  I believe it would also be remarkably
> slow --- doesn't setlocale() involve reading a new locale definition
> file from whereever those are stored?
Yes, speed can be problem. I will test it. But I hope libc read localesone time  only. The common usage  is with
SELECTwhere you  apply samelocales to all lines of result.
 

> I think the ultimate solution to our multi-locale problems will have to
> involve abandoning the C library's support functions and writing locale
Yes, but I think nls_string() is nice solution for now. Butter than say"no way"... :-)
   Karel

-- Karel Zak  <zakkr@zf.jcu.cz>http://home.zf.jcu.cz/~zakkr/


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: ORDER BY different locales
Next
From: Andrew Dunstan
Date:
Subject: log_line_info