Re: reducing NUMERIC size for 9.1 - Mailing list pgsql-hackers

From Robert Haas
Subject Re: reducing NUMERIC size for 9.1
Date
Msg-id AANLkTimRX+XQRH4fdjrA=8cvbuR5GQom+w4=hh7z90JY@mail.gmail.com
Whole thread Raw
In response to Re: reducing NUMERIC size for 9.1  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: reducing NUMERIC size for 9.1
List pgsql-hackers
On Fri, Jul 30, 2010 at 1:13 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> But, looking at it a bit more carefully, isn't the maximum-size logic
>> for numeric rather bogus?
>
> Perhaps, but I think you're confused on at least one point.
> numeric(2,1) has to be able to hold 2 decimal digits, not 2
> NumericDigits (which'd actually be 8 decimal digits given
> the current code).

I get that.  The point is: if one of those 2 decimal digits is before
the decimal point and the other is after it, then two NumericDigits
will be used.  The value '11'::numeric is only size 10 (untoasted),
but the value '1.1'::numeric is size 12 (untoasted).

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company


pgsql-hackers by date:

Previous
From: Jan Urbański
Date:
Subject: Re: TwoPO: experimental join order algorithm
Next
From: Vincenzo Romano
Date:
Subject: Re: On Scalability