Re: [HACKERS] Broken select on regular expression !!! - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Broken select on regular expression !!!
Date
Msg-id 29781.927124322@sss.pgh.pa.us
Whole thread Raw
In response to Broken select on regular expression !!!  (Constantin Teodorescu <teo@flex.ro>)
Responses Re: [HACKERS] Broken select on regular expression !!!  (Tatsuo Ishii <t-ishii@sra.co.jp>)
List pgsql-hackers
Constantin Teodorescu <teo@flex.ro> writes:
> select * from regdemo where fld1 ~* '^41|^des';
> fld1
> ----
> (0 rows)

> ^^^^^^^^^^^^^^
> !?!?!?!

I see it too.  Even more interesting is that these variants are OK:

regression=> select * from regdemo where fld1 ~* '^des|^41';
fld1
-----------
410
destination
(2 rows)

regression=> select * from regdemo where fld1 ~* '(^41)|(^des)';
fld1
-----------
410
destination
(2 rows)

And if you want *really* disturbing:

regression=> select * from regdemo where fld1 ~* '^sou|^des';
fld1
-----------
source
destination
(2 rows)

regression=> select * from regdemo where fld1 ~ '^sou|^des';
fld1
----
(0 rows)

Something is rotten in the state of Denmark...
        regards, tom lane


pgsql-hackers by date:

Previous
From: "D'Arcy" "J.M." Cain
Date:
Subject: Re: [HACKERS] PyGreSQL 2.4
Next
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] PyGreSQL 2.4