Re: [HACKERS] Bug in LIKE ?

Daniele Orlandi <daniele@orlandi.com>

From: Daniele Orlandi <daniele@orlandi.com>
To: The Hermit Hacker <scrappy@hub.org>
Date: 1999-06-07T12:27:46Z
Lists: pgsql-hackers
> If I understand this correctly, IMHO, this would be asking for '^Sigma'
> with at least one character after the 'a' ...

Uhm.... I think the problem is a little worse:

create table a ( b varchar(32) );
insert into a values ( 'foo' );
insert into a values ( 'bar' );
insert into a values ( 'foobar' );
insert into a values ( 'foobar2' );

PostgreSQL 6.4.2

tacacs=> select * from a where b like 'foo%';
b
-------
foo
foobar
foobar2
(3 rows)

PostgreSQL 6.5beta2

tacacs=> select * from a where b like 'foo%';
b
-
(0 rows)

tacacs=> select * from a where b like '%foo';
b
---
foo
(1 row)

tacacs=> select * from a where b ~ '^foo';
b
-------
foo
foobar
foobar2
(3 rows)

Bye.
 
-- 
 Daniele

-------------------------------------------------------------------------------
 Daniele Orlandi - Utility Line Italia - http://www.orlandi.com
 Via Mezzera 29/A - 20030 - Seveso (MI) - Italy
-------------------------------------------------------------------------------