Re: NUMERIC size - Mailing list pgsql-docs

From Robert Haas
Subject Re: NUMERIC size
Date
Msg-id CA+TgmoZcNyWUBFVUUAGostd-EPsfecdVHY1F+ZRxziOuwfFO7g@mail.gmail.com
Whole thread Raw
In response to NUMERIC size  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-docs
On Wed, Mar 21, 2012 at 10:35 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
>> Numeric values are physically stored without any extra leading or
>> trailing zeroes. Thus, the declared precision and scale of a column
>> are maximums, not fixed allocations. (In this sense the numeric type
>> is more akin to varchar(n) than to char(n).) The actual storage
>> requirement is two bytes for each group of four decimal digits,
>> plus five to eight bytes overhead.
>
> The last sentence of the above seems not to be correct. Because,
> thanks to the reduction of NUMERIC size (committed in 9.1), its header
> size is three, five or eight for now. Attached patch fixes this.

Nice catch.  Committed.

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

pgsql-docs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Cannot build docs on Ubuntu 10.04?
Next
From: Robert Haas
Date:
Subject: Re: [PATCH] Use idiomatic style for varlena structs