Re: [HACKERS] another locale problem

From: Daniel Kalchev <daniel(at)digsys(dot)bg>
To: t-ishii(at)sra(dot)co(dot)jp
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] another locale problem
Date: 1999-06-11 10:38:57
Message-ID: 199906111038.NAA28105@dcave.digsys.bg
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Btree index.

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

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 1999-06-11 10:44:05 Re: [HACKERS] postgres processes
Previous Message Vadim Mikheev 1999-06-11 10:08:17 Re: [HACKERS] Beta4 Available ...