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

From Tom Lane
Subject Re: ORDER BY different locales
Date
Msg-id 11784.1077804963@sss.pgh.pa.us
Whole thread Raw
In response to ORDER BY different locales  (Karel Zak <zakkr@zf.jcu.cz>)
Responses Re: ORDER BY different locales  (Karel Zak <zakkr@zf.jcu.cz>)
Re: ORDER BY different locales  (Greg Stark <gsstark@mit.edu>)
Re: ORDER BY different locales  (Karel Zak <zakkr@zf.jcu.cz>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Check Constraints and pg_dump
Next
From: Karel Zak
Date:
Subject: Re: ORDER BY different locales