Re: MySQL search query is not executing in Postgres DB - Mailing list pgsql-hackers

From Tom Lane
Subject Re: MySQL search query is not executing in Postgres DB
Date
Msg-id 2351.1329508975@sss.pgh.pa.us
Whole thread Raw
In response to Re: MySQL search query is not executing in Postgres DB  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> Assuming we had the cast, What would "intval like '1%'" mean? You're 
> going to match 1, 10..19, 100..199, 1000..1999 ...

> Now maybe there's a good use for such a test, but I'm have a VERY hard 
> time imagining what it might be.

Yeah, that's another point worth asking.  Coercing an integer to text
and then doing LIKE on it is an extremely inefficient way to do what's
probably the wrong thing anyhow.  I would be interested to know exactly
why the OP wants to do this, and whether it couldn't be done better with
some arithmetical test.

In this connection it's worth remembering that when we removed some
implicit casts in 8.3, we heard lots of yelling, and we also heard from
lots of people who found bugs in their SQL code that the implicit casts
had masked.  Allowing LIKE-on-anything could be a rerun of that mess.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: MySQL search query is not executing in Postgres DB
Next
From: Robert Haas
Date:
Subject: Re: MySQL search query is not executing in Postgres DB