Re: dividing money by money

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Peter Eisentraut" <peter_e(at)gmx(dot)net>
Cc: "Andy Balholm" <andy(at)balholm(dot)com>,<pgsql-hackers(at)postgresql(dot)org>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: dividing money by money
Date: 2010-07-17 15:00:36
Message-ID: 4C417F4402000025000337E9@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-www

Peter Eisentraut <peter_e(at)gmx(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2010-07-17 15:14:29 Re: SHOW TABLES
Previous Message Tom Lane 2010-07-17 14:39:14 Re: dividing money by money

Browse pgsql-www by date

  From Date Subject
Next Message Peter Eisentraut 2010-07-18 09:00:33 Re: dividing money by money
Previous Message Tom Lane 2010-07-17 14:39:14 Re: dividing money by money