Re: type casting in 8.3

From: thefronny(at)gmail(dot)com
To: pgsql-general(at)postgresql(dot)org
Subject: Re: type casting in 8.3
Date: 2008-02-12 01:55:43
Message-ID: bdb94319-29dc-47ae-9f4c-419ab1847752@p69g2000hsa.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Feb 11, 3:15 am, "${spencer}" <spenc(dot)(dot)(dot)(at)gmail(dot)com> wrote:
> I just literally ran my first search of the day and got the same
> error.
>
> i changed my query so that the integer was cast into text and then it
> worked fine.
>
> thefro(dot)(dot)(dot)(at)gmail(dot)com wrote:
> > All,
>
> > I'm getting the following (new) (php?) error on a database recently
> > moved from 8.2.6 to 8.3. I know there's been changes with casts in 8.3
> > and I intend to learn how to fix them but I don't know how to
> > interpret the error:
>
> > ERROR: operator does not exist: character <> integer LINE 1: ...
> > 303841-9' and amount > 0 and quant > 0 and reg_id != 99) gro... ^
> > HINT: No operator matches the given name and argument type(s). You
> > might need to add explicit type casts.
>
> > I think that
>
> > operator does not exist: character <> integer
>
> > is the key here. Does it mean the query is trying to interpret a text
> > string as an integer? The string ...303841-9 is an ISBN number and is
> > char(16) in the table.
>
> > Thanks for any pointers or links to a tutorial.
>
> > tf

Ya know, I found and fixed my problem today at work. I just explicitly
cast everything in the query and as I worked my way through it I
watched how the error message changed. At the very end I came up to
something like "...and store != $store". I changed it to "...and
store != '$store'" and, bingo the query worked again. Then I backed
out all the :: casting I had done and everything still worked. 'magine
that.

tf

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gerald Timothy Quimpo 2008-02-12 02:03:08 Re: Continual uptime while loading data ... COPY vs INSERTS within a transaction.
Previous Message Willem Buitendyk 2008-02-12 01:21:00 Re: SPI_ERROR_CONNECT