Re: MySQL search query is not executing in Postgres DB

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: MySQL search query is not executing in Postgres DB
Дата
Msg-id 4F3EC382.2020101@gmail.com
обсуждение исходный текст
Ответ на Re: MySQL search query is not executing in Postgres DB  (Marti Raudsepp <marti@juffo.org>)
Ответы Re: MySQL search query is not executing in Postgres DB
Список pgsql-general
On 02/17/2012 08:01 AM, Marti Raudsepp wrote:
> On Fri, Feb 17, 2012 at 17:13, Adrian Klaver<adrian.klaver@gmail.com>  wrote:
>> Why not use:
>> " SELECT * FROM<Table-name>  WHERE CAST(Table.ID as TEXT) LIKE '1%' "
>>
>> as the MySQL query also?  MySQL supports the CAST function.
>
> Nope, trying to use CAST() in an interoperable manner is a lost cause.
> Sadly MySQL and PostgreSQL don't agree over the cast types. MySQL's
> CAST doesn't recognize varchar or text. Both support CHAR, but they
> work differently (MySQL's char behaves like PostgreSQL's varchar):
>

Well I guess the choices are put back the implicit cast or change the
data type of the Table.ID column in Postgres to varchar.

>
>
> Regards,
> Marti


--
Adrian Klaver
adrian.klaver@gmail.com

В списке pgsql-general по дате отправления:

Предыдущее
От: Andy Colson
Дата:
Сообщение: Re: select as params to function
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Pokey Fedora Updates for Postgresql?