Re: Implicit CAST is not working in Postgresql 8.4

From: Thom Brown <thom(at)linux(dot)com>
To: AI Rumman <rummandba(at)gmail(dot)com>
Cc: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Implicit CAST is not working in Postgresql 8.4
Date: 2010-09-28 06:45:45
Message-ID: AANLkTinEw950EZOG458+cu-sqm_A2WC3Wn3iRvT4QwkV@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 28 September 2010 07:37, AI Rumman <rummandba(at)gmail(dot)com> wrote:
> I migrated data from Postgresql 8.1 to  Postgresql 8.4 using pg_dump.
> But now I found that, most of the queries in my applicaiton are being
> failed. Invesitigating the problem, I found that no function is available in
> the DB to CAST INT to TEXT etc.
> Most of the queries are failed because implicit cast is not working
> properly.
> Any idea how to solve it.

As of 8.3 non-text types don't automatically cast to text. You'll
need to use a cast.

So:

WHERE my_int_col = my_text_col

becomes

WHERE my_int_col::text = my_text_col

Regards
--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-09-28 06:46:21 Re: ECPG - Some errno definitions don't match to the manual
Previous Message AI Rumman 2010-09-28 06:37:46 Implicit CAST is not working in Postgresql 8.4