postgresql/src
Tom Lane ca918f99aa Fix loss of fractional digits for large values in cash_numeric().
Money values exceeding about 18 digits (depending on lc_monetary)
could be inaccurately converted to numeric, due to select_div_scale()
deciding it didn't need to compute any fractional digits.  Force
its hand by setting the dscale of one division input to equal the
number of fractional digits we need.

In passing, rearrange the logic to not do useless work in locales
where money values are considered integral.

Per bug #15925 from Slawomir Chodnicki.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/15925-da9953e2674bb5c8@postgresql.org
2019-07-26 11:59:00 -04:00
..
backend Fix loss of fractional digits for large values in cash_numeric(). 2019-07-26 11:59:00 -04:00
bin Fix infelicities in describeOneTableDetails' partitioned-table handling. 2019-07-24 18:14:46 -04:00
common Tolerate EINVAL when calling fsync() on a directory. 2019-02-24 23:51:54 +13:00
fe_utils Fix translation of special characters in psql's LaTeX output modes. 2018-11-26 17:32:51 -05:00
include Install dependencies to prevent dropping partition key columns. 2019-07-22 14:55:23 -04:00
interfaces Fix failures to ignore \r when reading Windows-style newlines. 2019-07-25 12:11:19 -04:00
makefiles Define WIN32_STACK_RLIMIT throughout win32 and cygwin builds. 2019-04-09 08:25:42 -07:00
pl Ensure plpgsql result tuples have the right composite type marking. 2019-07-03 18:08:53 -04:00
port Stamp 11.4. 2019-06-17 17:15:30 -04:00
template Yet further rethinking of build changes for macOS Mojave. 2018-11-02 18:54:00 -04:00
test Fix loss of fractional digits for large values in cash_numeric(). 2019-07-26 11:59:00 -04:00
timezone Silence compiler warning, hopefully. 2019-07-19 14:49:10 -04:00
tools Fix syntax error in commit 20e99cddd. 2019-07-25 14:42:12 -04:00
tutorial Update copyright for 2018 2018-01-02 23:30:12 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Consistently test for in-use shared memory. 2019-04-12 22:36:42 -07:00
Makefile.shlib Ensure static libraries have correct mod time even if ranlib messes it up. 2018-11-29 15:53:44 -05:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00