precision of numeric type - Mailing list pgsql-jdbc

From w.winter
Subject precision of numeric type
Date
Msg-id 003001c27d9e$e53fe5b0$667ba8c0@panzerknacker
Whole thread Raw
Responses Re: precision of numeric type  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-jdbc
Hi,

on testing our auto-configuration persistence framework ACP against
PostgreSQL we found the following problem:

I have a table with a column of type numeric(48,10). The PostgreSQL docs
say: "The type numeric can store numbers of practically unlimited size and
precision, while being able to store all numbers and carry out all
calculations exactly."

I store the Double value 1212121234.5634349876 with a
PreparedStatement.setDouble()

I make a PreparedStatement with SELECT FROM TESTTABLE WHERE TESTCOLUMN=?
and set the Parameter with
stmt.setDouble(1, new Double(1212121234.56343498));

The row will be found!

The same happens when I do
stmt.setString(1, String.valueOf(new Double(1212121234.56343498)));

and if I do
stmt.setDouble(1, new Double(1212121234.5634349));
an error is produced : Unable to identify an operator '=' for types
'numeric' and 'double precision'

it seems to me, the behaviour with numeric datatypes is not consistent.

Wolfgang

___________________
Dr. Wolfgang Winter
LogiTags Systems
www.logitags.com


pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: getTables()
Next
From: "w.winter"
Date:
Subject: Supplement