Re: [HACKERS] another locale problem - Mailing list pgsql-hackers

From Daniel Kalchev
Subject Re: [HACKERS] another locale problem
Date
Msg-id 199906111038.NAA28105@dcave.digsys.bg
Whole thread Raw
In response to Re: [HACKERS] another locale problem  (Tatsuo Ishii <t-ishii@sra.co.jp>)
List pgsql-hackers
>>>Tatsuo Ishii said:> >This worked, however it made all selects of ~* '^sometext' sequential.> > That's correct
behavior.>> >Why can't we use index searches in this case? I believe it is :-)> > No. It's due to the nature of the
Btreeindex.
 

But why it did use index scan when the case of the field and the expression 
matched and did find the correct results?
> >But this> >> >SELECT key FROM t WHERE key ~* '^ sometext';> > Again, that should not be index scan.

SELECT key FROM t WHERE key ~* '^ ';

(space only) uses index and works correctly.... weird!
> BTW, if you want to play with regex, you might find retest.c be> useful. You can build the test tool by:> > make
retest>> enjoy:-)
 


In a wild guess I changed all 'char' to 'unsigned char' in regcomp.c, with no 
positive or negative results. Maybe there are other places in regex where this 
should be done, such as regexec.c? Is there an regex guru over here ... :-)

My long-time wondering about regex in Postgres has always been - isn't there 
something better than this old regex code that we can use?

Daniel



pgsql-hackers by date:

Previous
From: Vadim Mikheev
Date:
Subject: Re: [HACKERS] Beta4 Available ...
Next
From: wieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] postgres processes