Daniel Kalchev <daniel@digsys.bg> writes:
> To summarize the problem. If key contains (equivalent cyrillic
> letters) 'ABC', 'ABCD', 'DAB' and 'ABX' and the query is:
> SELECT key FROM t WHERE key ~* '^AB';
> index scan will be used and the correct tuples ('ABC', 'ABCD' and
> 'ABX') will be returned. If the query is
> SELECT key FROM t WHERE key ~* '^ab';
> index scan will be used and no tuples will be returned.
Hm. Is it possible that isalpha() is doing the wrong thing on your
machine? makeIndexable() currently assumes that isalpha() returns true
for any character that is subject to case conversion, but I wonder
whether that's a good enough test.
The other possibility is that regexp's internal handling of
case-insensitive matching is not right.
regards, tom lane