Re: Setting locale per connection
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Cc: Behdad Esfahbod <behdad@bamdad.org>, PostgreSQL Development <pgsql-hackers@postgresql.org>
Date: 2003-07-02T05:58:57Z
Lists: 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