Re: Numeric field quirk [Again] - Mailing list pgsql-hackers

From Jan Wieck
Subject Re: Numeric field quirk [Again]
Date
Msg-id 200010050844.DAA05070@jupiter.jw.home
Whole thread Raw
In response to Numeric field quirk [Again]  (Matthew Hagerty <matthew@venux.net>)
List pgsql-hackers
Matthew Hagerty wrote:
> Greetings,
>
> Well, it seems that the numeric issue I was having has nothing to do with
> the precision and scale being set the same, it has to do with the input
> data.  The precision has to be at least 2 greater than the biggest number
> you need to enter, i.e.
>
> equinox=# create table test ( d numeric(4,2) );
> CREATE
> equinox=# insert into test values(10);
> INSERT 167844 1
> equinox=# insert into test values(101);
> ERROR:  overflow on numeric ABS(value) >= 10^2 for field with precision 4
> scale 2
   The  scale  digits  aren't  added,  they  are  taken from the   precision   specified   digits.   Numeric(4.2)   is
 99.99,   numeric(8.2)  is 999999.99 and numeric(4.4) is .9999 - so the   above looks correct to me.
 


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Numeric field quirk [Again]
Next
From: darcy@druid.net (D'Arcy J.M. Cain)
Date:
Subject: Re: [ANNOUNCE] Announce: Release of PyGreSQL version 3.0