Commit cdc15b24 authored by Bruce Momjian's avatar Bruce Momjian

Improve error message when NUMERIC precision is exceeded.

parent 7a9d197f
...@@ -14,7 +14,7 @@ ...@@ -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) ...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment