Re: Different exponent in error messages - Mailing list pgsql-general

From Michael Fuhr
Subject Re: Different exponent in error messages
Date
Msg-id 20060111223431.GA88428@winnie.fuhr.org
Whole thread Raw
In response to Re: Different exponent in error messages  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Different exponent in error messages  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Wed, Jan 11, 2006 at 04:09:23PM -0500, Tom Lane wrote:
> "Andrus" <eetasoft@online.ee> writes:
> > Why Postgres 8.1.1 in XP returns different exponents ( 10^6, 10^9, 10^7) for
> > field with precision 9, scale 3 ?
>
> Could we see a complete test case --- ie, what are the input values
> causing these messages?

I think this is what Andrus is seeing:

test=> CREATE TABLE foo (n numeric(9,3));
CREATE TABLE
test=> INSERT INTO foo VALUES (1000000);
ERROR:  numeric field overflow
DETAIL:  The absolute value is greater than or equal to 10^6 for field with precision 9, scale 3.
test=> INSERT INTO foo VALUES (1000000000);
ERROR:  numeric field overflow
DETAIL:  The absolute value is greater than or equal to 10^9 for field with precision 9, scale 3.
test=> INSERT INTO foo VALUES (10000000);
ERROR:  numeric field overflow
DETAIL:  The absolute value is greater than or equal to 10^7 for field with precision 9, scale 3.

--
Michael Fuhr

pgsql-general by date:

Previous
From: "Guy Rouillier"
Date:
Subject: Re: Create Produre for DROP row
Next
From: Tom Lane
Date:
Subject: Re: Different exponent in error messages