diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-08-14 15:06:01 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-08-14 15:06:01 -0400 |
commit | 9389fbd0385776adf3252eb8cfe6e37a640fdff4 (patch) | |
tree | eb973d4986af7113771e01f79b7f12fa5c5e6e5b /src/test | |
parent | d6c9e05cb7db64239887fac65b243229594f331d (diff) | |
download | postgresql-9389fbd0385776adf3252eb8cfe6e37a640fdff4.tar.gz postgresql-9389fbd0385776adf3252eb8cfe6e37a640fdff4.zip |
Remove bogus dependencies on NUMERIC_MAX_PRECISION.
NUMERIC_MAX_PRECISION is a purely arbitrary constraint on the precision
and scale you can write in a numeric typmod. It might once have had
something to do with the allowed range of a typmod-less numeric value,
but at least since 9.1 we've allowed, and documented that we allowed,
any value that would physically fit in the numeric storage format;
which is something over 100000 decimal digits, not 1000.
Hence, get rid of numeric_in()'s use of NUMERIC_MAX_PRECISION as a limit
on the allowed range of the exponent in scientific-format input. That was
especially silly in view of the fact that you can enter larger numbers as
long as you don't use 'e' to do it. Just constrain the value enough to
avoid localized overflow, and let make_result be the final arbiter of what
is too large. Likewise adjust ecpg's equivalent of this code.
Also get rid of numeric_recv()'s use of NUMERIC_MAX_PRECISION to limit the
number of base-NBASE digits it would accept. That created a dump/restore
hazard for binary COPY without doing anything useful; the wire-format
limit on number of digits (65535) is about as tight as we would want.
In HEAD, also get rid of pg_size_bytes()'s unnecessary intimacy with what
the numeric range limit is. That code doesn't exist in the back branches.
Per gripe from Aravind Kumar. Back-patch to all supported branches,
since they all contain the documentation claim about allowed range of
NUMERIC (cf commit cabf5d84b).
Discussion: <2895.1471195721@sss.pgh.pa.us>
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/regress/expected/dbsize.out | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/regress/expected/dbsize.out b/src/test/regress/expected/dbsize.out index 20d8cb56893..e901a2c92a1 100644 --- a/src/test/regress/expected/dbsize.out +++ b/src/test/regress/expected/dbsize.out @@ -119,7 +119,7 @@ ERROR: bigint out of range SELECT pg_size_bytes('1e100'); ERROR: bigint out of range SELECT pg_size_bytes('1e1000000000000000000'); -ERROR: invalid size: "1e1000000000000000000" +ERROR: value overflows numeric format SELECT pg_size_bytes('1 byte'); -- the singular "byte" is not supported ERROR: invalid size: "1 byte" DETAIL: Invalid size unit: "byte". |