Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvRhW-00081o-CM for pgsql-bugs@arkaria.postgresql.org; Tue, 04 Apr 2017 16:53:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cvRhV-0002Jj-V7 for pgsql-bugs@arkaria.postgresql.org; Tue, 04 Apr 2017 16:53:02 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cvRhV-0002D8-1B for pgsql-bugs@postgresql.org; Tue, 04 Apr 2017 16:53:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cvRhS-0004y1-PF for pgsql-bugs@postgresql.org; Tue, 04 Apr 2017 16:52:59 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v34GqllU018087; Tue, 4 Apr 2017 12:52:47 -0400 From: Tom Lane To: Peter Eisentraut cc: Yasuo Ohgaki , pgsql-bugs@postgresql.org Subject: Re: Money type does not detect over/underflow unlike int/int8 In-reply-to: <4896501e-4a5c-26aa-5137-5d6e96495166@2ndquadrant.com> References: <4896501e-4a5c-26aa-5137-5d6e96495166@2ndquadrant.com> Comments: In-reply-to Peter Eisentraut message dated "Tue, 04 Apr 2017 09:56:28 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18085.1491324767.1@sss.pgh.pa.us> Date: Tue, 04 Apr 2017 12:52:47 -0400 Message-ID: <18086.1491324767@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Peter Eisentraut 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