Re: ORDER BY different locales

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ORDER BY different locales
Date: 2004-02-26 14:16:03
Message-ID: 11784.1077804963@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Karel Zak <zakkr(at)zf(dot)jcu(dot)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
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?

I think the ultimate solution to our multi-locale problems will have to
involve abandoning the C library's support functions and writing locale
support that allows multiple locale-defining structures referenced by
pointers. It's a big task though :-(. Peter was looking at it awhile
back but I don't know how far he's gotten.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Karam Chand 2004-02-26 14:18:57 Index Information
Previous Message Tom Lane 2004-02-26 14:07:42 Re: help using arrays in a function

Browse pgsql-hackers by date

  From Date Subject
Next Message Karel Zak 2004-02-26 14:45:43 Re: ORDER BY different locales
Previous Message Tom Lane 2004-02-26 13:54:59 Re: Check Constraints and pg_dump