Stephan Szabo <[EMAIL PROTECTED]> 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

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

Reply via email to