Search Postgresql Archives

Re: MySQL -> PostgreSQL conversion issue

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

 



On Thu, Oct 28, 2010 at 20:02, Scott Newton <scott.newton@xxxxxxxxxxxxx> wrote:
> On Fri, 29 Oct 2010 14:40:51 Tom Lane wrote:
>> Anyway, you've got two different typing violations there, so you need
>> two casts to fix it:

> Unfortunately not:
> from cc_call cdr left join cc_card cc on cdr.card_id=cc.id left join
> Â Â Â Â Â Â Â Â Â Â Â Â(select 'dnid' as dnid, 0.1 as sell_cost,0.1 as cost,0
> as dnid_type union Âselect 8887798764,0.02,0.06 ,1
> Â Â Â Â Â Â Â Â Â Â Â Â) as tf on
> tf.dnid::text=substr(cdr.dnid,1,length(tf.dnid::text))
>
> still gives
>
> 2010-10-29 14:58:09 NZDT ERROR: Âinvalid input syntax for integer: "dnid"

You can fix that by casting 8887798764 as text (or by making "dnid" an
int).  The columns for a union need to be of the same type.

-- 
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