Re: MySQL search query is not executing in Postgres DB

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: MySQL search query is not executing in Postgres DB
Дата
Msg-id 2351.1329508975@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: MySQL search query is not executing in Postgres DB  (Andrew Dunstan <andrew@dunslane.net>)
Список 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 по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: MySQL search query is not executing in Postgres DB
Следующее
От: Robert Haas
Дата:
Сообщение: Re: MySQL search query is not executing in Postgres DB