Re: Setting locale per connection - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Setting locale per connection
Date
Msg-id 24946.1057125537@sss.pgh.pa.us
Whole thread Raw
In response to Re: Setting locale per connection  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Responses Re: Setting locale per connection  (Behdad Esfahbod <behdad@bamdad.org>)
List pgsql-hackers
Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> On Wed, 2 Jul 2003, Behdad Esfahbod wrote:
>> so I have wrote my 10lines function as a wrapper around
>> setlocale, that is attached.

> Hmm, I'd think there'd be some potential for danger there.  I don't play
> with the locale stuff, but if the collation changes and you've got indexed
> text (varchar, char) fields, wouldn't the index no longer necessarily be
> in the correct order?

Indeed, this is exactly why Postgres goes out of its way to prevent you
from changing the backend's collation setting on-the-fly.  The proposed
function is a great way to shoot yourself in the foot :-(.  If you doubt
it, check the archives from two or three years ago when we did not have
the interlock to force LC_COLLATE to be frozen at initdb time ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: cvs build failure
Next
From: Kenji Sugita
Date:
Subject: PostgreSQL 7.4devel - LOG: PGSTAT: socket() failed: Invalid argument