Search Postgresql Archives

Re: Numeric type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 27/01/2005 01:06 phil campaigne wrote:
Hi All,
I have a double type in java that I am trying to store in postgresql as type numeric and it doesn't seem to like it. The error message is,
function double(numeric) does not exist
unable to identify a function that satisfies the given argument type
you may need to add explicit type casts.

use getBigDecimal()/setBigDecimal()


If I just want to store the number as 'xx.xx', is 'numeric' the right postgresql type?

It depends a lot on your precision requirements and whether or not small rounding errors matter in your application. For an accounting application, I would recommend using numeric and using BigDecimal in your Java code. If small rounding errors don't matter the you'll find using double precision (int8) in the databse and double in your Java code somewhat easier.


HTH

--
Paul Thomas
+------------------------------+-------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for Business           |
| Computer Consultants         | http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+-------------------------------------------+

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux