Subject: like vs '=' - Mailing list pgsql-hackers

From m w
Subject Subject: like vs '='
Date
Msg-id 20010130013437.66908.qmail@web12404.mail.yahoo.com
Whole thread Raw
List pgsql-hackers
> Subject: like vs '='
> 
> I have a function to transform text into a
> pseudo-metaphone variable, take this
> example:
> 
> cddbsql=# select song, metatext(song) from cdsongs
> where metatext(song) like
> metatext('born to run') limit 3 ;
>     song     | metatext
> -------------+----------
>  Born To Run | brntorn
>  Born To Run | brntorn
>  Born To Run | brntorn
> (3 rows)
> 
> Here is the problem: Depending on whether there is
> an index or not, 'like'
> behaves differently. Here is a transcript:
> 
> cddbsql=# select song, metatext(song) from cdsongs
> where metatext(song) like
> metatext('born to run') limit 1 ;
>     song     | metatext
> -------------+----------
>  Born To Run | brntorn
> (1 row)
>  
> cddbsql=# create index cdsongs_meta_song on cdsongs
> (metatext(song)) ;
> CREATE
> cddbsql=# select song, metatext(song) from cdsongs
> where metatext(song) like
> metatext('born to run') limit 1 ;
>  song | metatext
> ------+----------
> (0
> rows)
>       
> 
> This happens in both 7.0 and
> 7.1.
> -- 
> http://www.mohawksoft.com
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices. 
http://auctions.yahoo.com/


pgsql-hackers by date:

Previous
From: Najm Hashmi
Date:
Subject: Re: [SQL] 7.1beta4 bug creating a certain table
Next
From: darcy@druid.net (D'Arcy J.M. Cain)
Date:
Subject: Re: Can PyGreSQL be updated?