Commit 514d0f4d authored by Bruce Momjian's avatar Bruce Momjian

Update regression error message for NUMERIC range overflow. Display "1"

instead of 10^0.
parent cdc15b24
...@@ -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.89 2006/01/25 17:54:14 momjian Exp $ * $PostgreSQL: pgsql/src/backend/utils/adt/numeric.c,v 1.90 2006/01/25 18:15:03 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -3206,8 +3206,11 @@ apply_typmod(NumericVar *var, int32 typmod) ...@@ -3206,8 +3206,11 @@ 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("A field with precision %d, scale %d must have an absolute value less than 10^%d.", errdetail("A field with precision %d, scale %d must have an absolute value less than %s%d.",
precision, scale, maxdigits))); precision, scale,
/* Display 10^0 as 1 */
maxdigits ? "10^" : "",
maxdigits ? maxdigits : 1)));
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