File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 14
14
* Copyright (c) 1998-2006, PostgreSQL Global Development Group
15
15
*
16
16
* IDENTIFICATION
17
- * $PostgreSQL: pgsql/src/backend/utils/adt/numeric.c,v 1.94 2006/07/14 05:28:28 tgl Exp $
17
+ * $PostgreSQL: pgsql/src/backend/utils/adt/numeric.c,v 1.95 2006/10/03 21:25:55 momjian Exp $
18
18
*
19
19
*-------------------------------------------------------------------------
20
20
*/
@@ -3217,11 +3217,12 @@ apply_typmod(NumericVar *var, int32 typmod)
3217
3217
ereport (ERROR ,
3218
3218
(errcode (ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE ),
3219
3219
errmsg ("numeric field overflow" ),
3220
- errdetail ("A field with precision %d, scale %d must have an absolute value less than %s%d." ,
3220
+ errdetail ("A field with precision %d, scale %d must round to an absolute value less than %s%d." ,
3221
3221
precision , scale ,
3222
3222
/* Display 10^0 as 1 */
3223
3223
maxdigits ? "10^" : "" ,
3224
- maxdigits ? maxdigits : 1 )));
3224
+ maxdigits ? maxdigits : 1
3225
+ )));
3225
3226
break ;
3226
3227
}
3227
3228
ddigits -= DEC_DIGITS ;
Original file line number Diff line number Diff line change @@ -688,12 +688,12 @@ INSERT INTO fract_only VALUES (1, '0.0');
688
688
INSERT INTO fract_only VALUES (2, '0.1');
689
689
INSERT INTO fract_only VALUES (3, '1.0'); -- should fail
690
690
ERROR: numeric field overflow
691
- DETAIL: A field with precision 4, scale 4 must have an absolute value less than 1.
691
+ DETAIL: A field with precision 4, scale 4 must round to an absolute value less than 1.
692
692
INSERT INTO fract_only VALUES (4, '-0.9999');
693
693
INSERT INTO fract_only VALUES (5, '0.99994');
694
694
INSERT INTO fract_only VALUES (6, '0.99995'); -- should fail
695
695
ERROR: numeric field overflow
696
- DETAIL: A field with precision 4, scale 4 must have an absolute value less than 1.
696
+ DETAIL: A field with precision 4, scale 4 must round to an absolute value less than 1.
697
697
INSERT INTO fract_only VALUES (7, '0.00001');
698
698
INSERT INTO fract_only VALUES (8, '0.00017');
699
699
SELECT * FROM fract_only;
You can’t perform that action at this time.
0 commit comments