Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Ybe6e-0004ZW-Kg for pgsql-bugs@arkaria.postgresql.org; Fri, 27 Mar 2015 23:56:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Ybe6e-0008BG-3d for pgsql-bugs@arkaria.postgresql.org; Fri, 27 Mar 2015 23:56:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Ybe6d-0008B9-4n for pgsql-bugs@postgresql.org; Fri, 27 Mar 2015 23:56:03 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Ybe6V-0005iH-0h for pgsql-bugs@postgresql.org; Fri, 27 Mar 2015 23:56:02 +0000 Received: from localhost ([127.0.0.1]:17832 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtp (Exim 4.84 (FreeBSD)) (envelope-from ) id 1Ybe6Q-0001PU-Ii; Fri, 27 Mar 2015 23:55:50 +0000 From: Andrew Gierth To: Dean Rasheed Cc: Michael Paquier , Tom Lane , Pedro Gimeno , rschaaf@commoninf.com, "pgsql-bugs\@postgresql.org" Subject: Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version In-Reply-To: (Dean Rasheed's message of "Fri, 27 Mar 2015 17:16:01 +0000") Message-ID: <87384q2ejg.fsf@news-spur.riddles.org.uk> References: <20150320194337.2573.72944@wrigleys.postgresql.org> <26862.1427166720@sss.pgh.pa.us> <13096.1427204266@sss.pgh.pa.us> <55121967.90308@personal.formauri.es> <55129971.2070208@personal.formauri.es> <3736.1427294258@sss.pgh.pa.us> <5512E0AF.9050103@personal.formauri.es> <5512F2C0.9080007@personal.formauri.es> <8192.1427306273@sss.pgh.pa.us> <5512FE17.6020702@personal.formauri.es> <22366.1427313454@sss.pgh.pa.us> <87lhik4o45.fsf@news-spur.riddles.org.uk> <87h9t84ig5.fsf@news-spur.riddles.org.uk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) Date: Fri, 27 Mar 2015 23:55:50 +0000 MIME-Version: 1.0 Content-Type: text/plain 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 >>>>> "Dean" == Dean Rasheed writes: Dean> I'm not convinced that it is a good idea to change the default Dean> rounding mode for numeric. Dean> For one thing, numeric is commonly used for monetary data, and Dean> changing the default rounding mode might well break existing Dean> applications where rounding is important, and which rely on the Dean> current behaviour. On the other hand, we've had complaints (on IRC) from people doing calculations with monetary data who complain that we don't do round-to-even (which is widely known as "Banker's Rounding") as their requirements demand. To quote the last person who brought it up there: >> We have strict accounting practice to follow -- and our CFO has >> instructed to use even-rounding (aka bankers rounding)... and to not >> use our typical rounding behavior we learned in 1st grade. :) Dean> Adding a version of round() with support for a choice of various Dean> rounding modes might be a better way to go. There's still the issue of casting to ::numeric(m,n) to consider, and whatever internal rounding is being done in division and numeric functions. Dean> Also, if the default is being changed, I think that merits wider Dean> discussion (on a thread with a more appropriate title) to see if Dean> it is likely to be an issue for anyone. Absolutely. -- Andrew (irc:RhodiumToad) -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs