Re: Money type does not detect over/underflow unlike int/int8

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Yasuo Ohgaki <yohgaki(at)ohgaki(dot)net>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Money type does not detect over/underflow unlike int/int8
Date: 2017-04-04 16:52:47
Message-ID: 18086.1491324767@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
> On 3/31/17 19:03, Yasuo Ohgaki wrote:
>> However, money type does not detect over/underflow and results in
>> strange results.

> This has been fixed in PostgreSQL 10. Please test.

I think the only thing that's actually gotten done is fixing cash_in
to reject out-of-range input values. Somebody ought to fix all the
money arithmetic functions to notice overflow, too; though I'm not
very clear what would be a good strategy in places like cash_mul_flt8,
where you couldn't count on an exact result.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Sandeep Thakkar 2017-04-05 14:54:53 Re: [Critical] Question about PostgreSQL installation.
Previous Message David G. Johnston 2017-04-04 15:41:04 Re: BUG #14612: update monitor is not proxy aware, and throws up a pop-up warning