On Thu, 19 Nov 1998, Oleg Broytmann wrote:
>Hi!
>
>On Thu, 19 Nov 1998, Thomas G. Lockhart wrote:
>> > 2) The tests for char, varchar, select_implicit, select_having and
>> > rules fail when locale is enabled, and pass when locale is disabled.
>> > This is due to character comparisons being case insensitive when
>> > locale is enabled. I don't think this is the correct behaviour. I'd
>> > appreciate any hint on where to look to investigate this further.
>>
>> src/backend/utils/adt/varlena.c
>
> "character comparisons being case insensitive"? It is a problem in your
>locale, not in the comparison code (I hope). There is no such thing as
>"case-insensitive strcoll", and I just used strcoll in varlena.c.
> The same problem popped up many times among linux users. Just install
>correct locale - and all will run well. There are test programs in
>src/test/locale, look carefully. If you can - supply test data for your
>locale.
Well, after a bit of investigation, now I know where the problem is. When
you do a case sensitive comparison, 'A' is considered "smaller" than 'a'.
Except, of course, if you use Digital's strcoll() (agh!). The comparison
when locale is enabled isn't case insensitive. Simply, the "sensitivity"
is inverted: 'A' is considered *greater* than 'a' (but not equal, as I
first thought). When you use the 'C' locale (that is, no locale), then the
output of strcmp() and strcoll() is the same.
So, this is indeed a Digital Unix problem. I've made the same tests under
FreeBSD, and they work as expected on it.
The next question is what to do now. I will send a message to Digital so
they can fix this bug in future releases, but what do I do in the
meantime? The problem is not dangerous except if you rely on upper-case
letters being ordered before lower-case. I could make a custom "expected"
output so that the regression tests do not fail, or we could simply write
a "README.DigitalUnix" telling the story. Writing a custom strcoll() seems
a bit overkill. What do you think?
>(It looks like my messages to pgsql-*@postgresql.org are usually dropped to
>floor. If anyone see it - please confirm, send to: phd2@earthling.net. I
>have no problems receiving mail from these lists, neither sending to many
>other lists I am on).
Your message made it to the list (I received it two times, one from you
and other from the list).
-------------------------------------------------------------------
Pedro José Lobo Perea Tel: +34 91 336 78 19
Centro de Cálculo Fax: +34 91 331 92 29
EUIT Telecomunicación - UPM e-mail: pjlobo@euitt.upm.es