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
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