Re: Different exponent in error messages

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrus <eetasoft(at)online(dot)ee>, pgsql-general(at)postgresql(dot)org
Subject: Re: Different exponent in error messages
Date: 2006-01-11 22:34:31
Message-ID: 20060111223431.GA88428@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches

On Wed, Jan 11, 2006 at 04:09:23PM -0500, Tom Lane wrote:
> "Andrus" <eetasoft(at)online(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-01-11 22:52:46 Re: Different exponent in error messages
Previous Message Guy Rouillier 2006-01-11 21:40:22 Re: Create Produre for DROP row

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2006-01-11 22:35:42 Re: [PATCHES] Summary table trigger example race condition
Previous Message Tom Lane 2006-01-11 21:09:23 Re: Different exponent in error messages