Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 72F0C9FB787 for ; Thu, 28 Jun 2007 05:53:32 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 05949-02 for ; Thu, 28 Jun 2007 05:53:27 -0300 (ADT) X-Greylist: delayed 11:40:43.291729 by SQLgrey-1.7.4 Received: from elrond.aspix.it (host216-113-static.56-88-b.business.telecomitalia.it [88.56.113.216]) by postgresql.org (Postfix) with ESMTP id 2A1B19FB6F0 for ; Thu, 28 Jun 2007 05:53:27 -0300 (ADT) Received: from baraddur ([192.168.1.50]:33336 helo=bregalad.local) by elrond.aspix.it with esmtp (Exim 4.63) (envelope-from ) id 1I3pdW-00030m-Ub for pgsql-jdbc@postgresql.org; Thu, 28 Jun 2007 10:45:58 +0200 Message-ID: <46837705.5030008@aspix.it> Date: Thu, 28 Jun 2007 10:53:25 +0200 From: Edoardo Panfili User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; it; rv:1.8.1.4) Gecko/20070604 Thunderbird/2.0.0.4 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: error: operator does not exist: bigint = character varying References: <4682D2C9.1010406@aspix.it> <20532.1183006028@sss.pgh.pa.us> In-Reply-To: <20532.1183006028@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/110 X-Sequence-Number: 17172 Tom Lane ha scritto: > Edoardo Panfili 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? Only partially, there are other query that must be cleaned in my code, (it seems that postgres does more type checking in every new version, a good thing). > 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. All goes well now, thank you (also to Oliver). Edoardo -- Jabber: edoardopa@talk.google.com tel: 075 9142766