Improve error message when NUMERIC precision is exceeded.
This commit is contained in:
parent
7a9d197fda
commit
cdc15b24be
@ -14,7 +14,7 @@
|
|||||||
* Copyright (c) 1998-2005, PostgreSQL Global Development Group
|
* Copyright (c) 1998-2005, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/adt/numeric.c,v 1.88 2005/11/22 18:17:23 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/adt/numeric.c,v 1.89 2006/01/25 17:54:14 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -3206,8 +3206,8 @@ apply_typmod(NumericVar *var, int32 typmod)
|
|||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
|
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
|
||||||
errmsg("numeric field overflow"),
|
errmsg("numeric field overflow"),
|
||||||
errdetail("The absolute value is greater than or equal to 10^%d for field with precision %d, scale %d.",
|
errdetail("A field with precision %d, scale %d must have an absolute value less than 10^%d.",
|
||||||
ddigits - 1, precision, scale)));
|
precision, scale, maxdigits)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ddigits -= DEC_DIGITS;
|
ddigits -= DEC_DIGITS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user