- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit7e01c8e
committed
Remove bogus dependencies on NUMERIC_MAX_PRECISION.
NUMERIC_MAX_PRECISION is a purely arbitrary constraint on the precisionand scale you can write in a numeric typmod. It might once have hadsomething 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 limiton the allowed range of the exponent in scientific-format input. That wasespecially silly in view of the fact that you can enter larger numbers aslong as you don't use 'e' to do it. Just constrain the value enough toavoid localized overflow, and let make_result be the final arbiter of whatis too large. Likewise adjust ecpg's equivalent of this code.Also get rid of numeric_recv()'s use of NUMERIC_MAX_PRECISION to limit thenumber of base-NBASE digits it would accept. That created a dump/restorehazard for binary COPY without doing anything useful; the wire-formatlimit 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 whatthe 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 ofNUMERIC (cf commitcabf5d8).Discussion: <2895.1471195721@sss.pgh.pa.us>1 parent99396e6 commit7e01c8e
3 files changed
+16
-13
lines changedLines changed: 12 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
648 | 648 |
| |
649 | 649 |
| |
650 | 650 |
| |
651 |
| - | |
652 |
| - | |
653 |
| - | |
654 |
| - | |
655 | 651 |
| |
656 | 652 |
| |
657 | 653 |
| |
| |||
3338 | 3334 |
| |
3339 | 3335 |
| |
3340 | 3336 |
| |
3341 |
| - | |
3342 |
| - | |
| 3337 | + | |
| 3338 | + | |
| 3339 | + | |
| 3340 | + | |
| 3341 | + | |
| 3342 | + | |
| 3343 | + | |
| 3344 | + | |
| 3345 | + | |
| 3346 | + | |
3343 | 3347 |
| |
3344 |
| - | |
3345 |
| - | |
3346 |
| - | |
| 3348 | + | |
| 3349 | + | |
3347 | 3350 |
| |
3348 | 3351 |
| |
3349 | 3352 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
20 |
| - | |
21 |
| - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
22 | 23 |
| |
23 | 24 |
| |
24 | 25 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
263 | 263 |
| |
264 | 264 |
| |
265 | 265 |
| |
266 |
| - | |
267 |
| - | |
| 266 | + | |
268 | 267 |
| |
269 | 268 |
| |
270 | 269 |
| |
|
0 commit comments
Comments
(0)