Re: Matching types - Mailing list pgsql-jdbc

From Daniel Serodio
Subject Re: Matching types
Date
Msg-id 1044560716.837.52.camel@kelly.ckf
Whole thread Raw
In response to Matching types  (Vicente Alabau Gonzalvo <vicente.alabau-gonzalvo@cgey.com>)
List pgsql-jdbc
I had the same problem. It's a backend problem, not JDBC related. If you
try to "select val2 from test where val1=123.45" in a table defined as
"create table test (val1 numeric, val2 int)" in psql or any other
frontend you will have the exact same problem.

I was told that this would be fixed in PostgreSQL 7.3, but I don't have
a 7.3 server to check if it was fixed or not.

Bottom line: use an explicit cast. That's how we solved it. BTW, you
need to use explicit casts anyway if you want the server to use indices.

Hope this helps,
Daniel Serodio

On Mon, 2003-02-03 at 06:01, Vicente Alabau Gonzalvo wrote:
> Does anybody know how to get BigDecimal from numeric and how to put
> BigDecimal to numeric using jdbc?
> The first thing seems to work automaticaly.
> BigDecimal seems to be converted into double precision when put in a
> query. Then it can't be compared with a numeric value.
>
> ERROR:  Unable to identify an operator '=' for types 'numeric' and
> 'double precision'
>   You will have to retype this query using an explicit cast
>
> Can it be done without doing an explicit cast?
>
> Thanks in advance.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
--
Daniel Serodio <daniel@checkforte.com.br>
CheckForte


pgsql-jdbc by date:

Previous
From: Khondoker Mahmud
Date:
Subject: To SQL Store Procedure from Java application
Next
From: jr@amanue.com (Jim Rosenberg)
Date:
Subject: Re: moveToInsertRow SQL Exception "No Primary Keys"