Re: How useful is the money datatype? - Mailing list pgsql-general

From Sam Mason
Subject Re: How useful is the money datatype?
Date
Msg-id 20091004161213.GN5407@samason.me.uk
Whole thread Raw
In response to Re: How useful is the money datatype?  ("V S P" <pgsql-general@postgresql.org>)
Responses Re: How useful is the money datatype?
Re: How useful is the money datatype?
List pgsql-general
On Sat, Oct 03, 2009 at 10:14:53PM -0400, V S P wrote:
> Withing PG procedures at least in pgsql it is impossible to do 'money'
> calculations without a loss of precision.

The point is that on *any* computer it's impossible to perform arbitrary
calculations to infinite precision (i.e. "without a loss of precision as
you put it).

You can do things losslessly in certain common situations and the
numeric type in PG helps with a lot of these.

> There is an open source library by IBM that I use in my C++ code to do
> this, and may be it can be incorporated into PG
>
> it is called decNumber
> http://speleotrove.com/decimal/decnumber.html

How would this help over PG's existing numeric type?

Support for decimal floating point numbers would be nice, but I'm pretty
sure you're not asking for this.

> Micropayment systems (that for example, I am implementing) require to
> have a reasonably good precision. Support for currencies such as yen
> also dictates that reasonably large numbers are supported

Which limits do you find to be problematic in PG?

--
  Sam  http://samason.me.uk/

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: Re: query is taking longer time after a while
Next
From: Rich Shepard
Date:
Subject: Re: How useful is the money datatype?