Andy Balholm <a...@balholm.com> wrote:
 
>> That's hardly an improvement if you're concerned about lack of
>> exactness.
> 
> I know; I lose a couple of digits by using float8 instead of
> numeric, but it's much simpler and faster
 
It also has the advantage of being symmetrical with the other
operators.
 
> and if it returned numeric people would _think_ it was exact.
 
Well, I don't know how many people would expect an *exact* decimal
representation of dividing a number by three.  The case which had me
concerned was specifically division by one as a "back door" cast. 
With numeric we could guarantee *that* was exact.
 
> And if we have a cast to numeric, people who want those extra
> digits can cast to numeric before dividing.
 
And nobody has much reason to do the divide-by-one trick.
 
> But I do still have the numeric code that I tried, so if that's
> how people want to do it, I can provide it.
 
I'm inclined to think it's better to have an explicit cast from
money to numeric, as long as it is exact, and leave the division of
money by money as float8.  It does sort of beg the question of
whether we should support a cast back in the other direction,
though.  I think that would wrap this all up in a tidy package.
 
-Kevin

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to