Re: Invalid (null) int8, can't convert to float8 - Mailing list pgsql-sql

From Tim Pizey
Subject Re: Invalid (null) int8, can't convert to float8
Date
Msg-id 3AB6A70E.3B90236B@paneris.co.uk
Whole thread Raw
In response to Invalid (null) int8, can't convert to float8  (Tim Pizey <tim@paneris.co.uk>)
List pgsql-sql
Thanks a lot Tom, 

Tom Lane wrote:
> 
> Tim Pizey <tim@paneris.co.uk> 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/


pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: count() and multiple tables
Next
From: Stephan Szabo
Date:
Subject: Re: count() and multiple tables