From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Yasuo Ohgaki <yohgaki@ohgaki.net>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Money type does not detect over/underflow unlike int/int8
Date: Tue, 04 Apr 2017 12:52:47 -0400
Message-ID: <18086.1491324767@sss.pgh.pa.us> (raw)
In-Reply-To: <4896501e-4a5c-26aa-5137-5d6e96495166@2ndquadrant.com>
References: <CAGa2bXZ1uQecXWbtadNt02Kf=yWE0NyG+wm7RDMZhAMLNzX8bw@mail.gmail.com>
<4896501e-4a5c-26aa-5137-5d6e96495166@2ndquadrant.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Peter Eisentraut <peter.eisentraut@2ndquadrant.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
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, peter.eisentraut@2ndquadrant.com, yohgaki@ohgaki.net
Subject: Re: Money type does not detect over/underflow unlike int/int8
In-Reply-To: <18086.1491324767@sss.pgh.pa.us>
References: <CAGa2bXZ1uQecXWbtadNt02Kf=yWE0NyG+wm7RDMZhAMLNzX8bw@mail.gmail.com> <4896501e-4a5c-26aa-5137-5d6e96495166@2ndquadrant.com> <18086.1491324767@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox