Search Postgresql Archives

Re: MySQL search query is not executing in Postgres DB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 17, 2012 at 9:01 AM, Marti Raudsepp <marti@xxxxxxxxx> wrote:
> On Fri, Feb 17, 2012 at 17:13, Adrian Klaver <adrian.klaver@xxxxxxxxx> 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):

Have you tried casting to varchar(1000) or something like that?

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux