Re: dividing money by money - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: dividing money by money
Date
Msg-id 4C417F4402000025000337E9@gw.wicourts.gov
Whole thread Raw
In response to Re: dividing money by money  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: dividing money by money
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> wrote:
> I read most of these messages rather as advocating the use of
> NUMERIC.
Yeah, I did advocate that at first, but became convinced float8 was
more appropriate.
> Also, the multiplication problem can be addressed by adding a
> money * numeric operator.
True.  If we added money * numeric, then it would make more sense to
have money / money return numeric.  On the other hand, I couldn't
come up with enough use cases for that to feel that it justified the
performance hit on money / money for typical use cases -- you
normally want a ratio for things where float8 is more than
sufficient; and you can always cast the arguments to numeric for
calculations where the approximate result isn't good enough. 
Basically, once we agreed to include casts to and from numeric, it
seemed to me we had it covered.
We're certainly in much better shape to handle exact calculations
now that we have the casts than we were before.
-Kevin


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: dividing money by money
Next
From: "Kevin Grittner"
Date:
Subject: Re: SHOW TABLES