Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id A32749FBF5A for ; Thu, 28 Jun 2007 01:47:17 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 96873-02 for ; Thu, 28 Jun 2007 01:47:12 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 821D99FBEE7 for ; Thu, 28 Jun 2007 01:47:13 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l5S4l88R020533; Thu, 28 Jun 2007 00:47:08 -0400 (EDT) To: Edoardo Panfili cc: pgsql-jdbc@postgresql.org Subject: Re: error: operator does not exist: bigint = character varying In-reply-to: <4682D2C9.1010406@aspix.it> References: <4682D2C9.1010406@aspix.it> Comments: In-reply-to Edoardo Panfili message dated "Wed, 27 Jun 2007 23:12:41 +0200" Date: Thu, 28 Jun 2007 00:47:08 -0400 Message-ID: <20532.1183006028@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/108 X-Sequence-Number: 17170 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? 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