Substring function incorrect when searching for '@.' - Mailing list pgsql-bugs

From Mike G.
Subject Substring function incorrect when searching for '@.'
Date
Msg-id 20041012223517.GA4549@localhost.localdomain
Whole thread Raw
Responses Re: Substring function incorrect when searching for '@.'
List pgsql-bugs
To reproduce:

create a table with  a data type of varchar (50) and name it email

insert into this table the following values:
test1@anyemail.com

Execute the following statement:
SELECT CASE WHEN count(substring(email FROM '@.')) > 0 THEN count(substring(email FROM '@.')) ELSE 0 END, email FROM
your_schema.your_tableGROUP BY email; 

Result with be equal to 1 / True.  It should be 0 / False.

If you execute the above but replace '@.' with '@a' it will also return 1 / True is correct.

The only time it fails for me is if the @ is immediately followed by a period.

7.3.4 using psql via pgadminIII under cygwin.

Mike

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Fatal "make check" bug with 8.0 beta 3 under Mac OS 10.3
Next
From: Tom Lane
Date:
Subject: Re: Substring function incorrect when searching for '@.'