Re: numeric field overflow - Mailing list pgsql-general

From Christophe Pettus
Subject Re: numeric field overflow
Date
Msg-id D929343B-E526-4999-871E-EE2B89F5236B@thebuild.com
Whole thread Raw
In response to numeric field overflow  (Nurzhan Kirbassov <km.sameboy@gmail.com>)
List pgsql-general
On Oct 5, 2009, at 11:20 PM, Nurzhan Kirbassov wrote:
> So, does the precision part of the numeric type really means number of
> digits to the left of the decimal point, or what ?


NUMERIC is behaving as documented.  The way to think of it is when you
are inserting:

    INSERT INTO test.test VALUES (10000)

into a NUMERIC(5,1), what you are doing is inserting:

    INSERT INTO test.test VALUES (10000.0)

10000.0 has six significant digits, rather than five, so the insert
fails.
--
-- Christophe Pettus
    xof@thebuild.com


pgsql-general by date:

Previous
From: Nurzhan Kirbassov
Date:
Subject: numeric field overflow
Next
From: Scott Marlowe
Date:
Subject: Re: numeric field overflow