Received: from mailhost1.dircon.co.uk (mailhost1.dircon.co.uk [194.112.32.65]) by mail.postgresql.org (8.11.3/8.11.1) with ESMTP id f2K0fIN61145 for ; Mon, 19 Mar 2001 19:41:19 -0500 (EST) (envelope-from tim@paneris.co.uk) Received: from paneris.co.uk (paneris.co.uk [194.112.47.112]) by mailhost1.dircon.co.uk (8.9.3/8.9.3) with ESMTP id AAA34405 for ; Tue, 20 Mar 2001 00:41:15 GMT Message-ID: <3AB6A70E.3B90236B@paneris.co.uk> Date: Tue, 20 Mar 2001 00:40:46 +0000 From: Tim Pizey Organization: Context Computing X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 CC: pgsql-sql@postgresql.org Subject: Re: Invalid (null) int8, can't convert to float8 References: <3AB6417C.A4932BA4@paneris.co.uk> <20699.985027478@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200103/381 X-Sequence-Number: 2049 Thanks a lot Tom, Tom Lane wrote: > > Tim Pizey writes: > We have had some discussions about teaching the parser to be smarter > about choosing the type of numeric constants depending on context, > but for now you need to force the issue: > > select id from chapter where textid = 9057599501::int8; > > If you want the index to be used then you'd better do this all the > time, not only for values that are too big to be int4. > This problem is actually happening through jdbc, using PreparedStatements, shouldn't jdbc be able to deal with casting transparently? I am calling this with a string "chapter = ?" which automatically quotes and escapes string values correctly. Hope this isn't too wrong timp -- Member of http://www.paneris.org/