pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Edoardo Panfili <edoardo@aspix.it>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: error: operator does not exist: bigint = character varying
Date: Thu, 28 Jun 2007 00:47:08 -0400
Message-ID: <20532.1183006028@sss.pgh.pa.us> (raw)
In-Reply-To: <4682D2C9.1010406@aspix.it>
References: <4682D2C9.1010406@aspix.it>

Edoardo Panfili <edoardo@aspix.it> writes:
> Now my application raises this exception (all was ok with 8.2):
> org.postgresql.util.PSQLException: ERROR: operator does not exist: 
> bigint = character varying

> this is my code fragment
> ----------------------------------------------------------------------
> PreparedStatement ps = connessione.prepareStatement("SELECT 
> strato.idplot, strato.idstrato, strato.nome, strato.copertura, 
> strato.altezza, strato.note FROM plot WHERE idplot=?");
> ps.setString(1, rilievo.dato[Rilievo.ID]);
> ----------------------------------------------------------------------
> the type of idplot is
> "idplot integer NOT NULL DEFAULT nextval('sequenza_plot'::regclass)"

Better look again, because that error message says that the lefthand
input is bigint not integer.  Are you looking at the right table?

In any case you should not be using setString() for an integer query
parameter.  This would have worked in 8.2 only for rather small values
of "work" --- you would have gotten a textual not a numeric comparison,
which among other things would have defeated the use of any index on the
idplot column.

			regards, tom lane



view thread (5+ messages)  latest in thread

Message-ID: <20532.1183006028@sss.pgh.pa.us>
Permalink:  ../20532.1183006028@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20532.1183006028@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, edoardo@aspix.it
  Subject: Re: error: operator does not exist: bigint = character varying
  In-Reply-To: <20532.1183006028@sss.pgh.pa.us>
  References: <4682D2C9.1010406@aspix.it> <20532.1183006028@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox