Re: dividing money by money

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

On fre, 2010-07-16 at 08:55 -0500, Kevin Grittner wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
>
> > I didn't see any discussion about why this should return float8
> > rather than numeric. It seems wrong to use float8 for this.
>
> That discussion took place several months ago on the -bugs list.
> I'll paste some links from a quick search of the archives below.
> Since multiplication of money is by float8 and not numeric, it
> ultimately seemed more consistent to me to have the results of
> division be float8. I felt that as long as we had a cast between
> money and numeric, someone could always cast to numeric if they
> wanted that style of division.
>
> http://archives.postgresql.org/pgsql-bugs/2010-03/msg00233.php
> http://archives.postgresql.org/pgsql-bugs/2010-03/msg00241.php
> http://archives.postgresql.org/pgsql-bugs/2010-03/msg00244.php
> http://archives.postgresql.org/pgsql-bugs/2010-03/msg00245.php
> http://archives.postgresql.org/pgsql-bugs/2010-04/msg00006.php

I read most of these messages rather as advocating the use of NUMERIC.

Also, the multiplication problem can be addressed by adding a money *
numeric operator.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2010-07-17 10:20:54 Re: dividing money by money
Previous Message Peter Eisentraut 2010-07-17 10:18:50 Re: dividing money by money

Browse pgsql-www by date

  From Date Subject
Next Message Peter Eisentraut 2010-07-17 10:20:54 Re: dividing money by money
Previous Message Peter Eisentraut 2010-07-17 10:18:50 Re: dividing money by money