Subject: Storage requirements for NUMERIC

From: David Fetter <[email-masked]>
Date: Sat, 30 Apr 2005 17:03:36 -0700

Folks,

Please find a patch per IRC chat yesterday that clarifies how much
space a NUMERIC takes.

Cheers,
D
-- 
David Fetter [email-masked] http://fetter.org/
phone: +1 510 893 6100   mobile: +1 415 235 3778

Remember to vote!
Index: doc/src/sgml/datatype.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/datatype.sgml,v
retrieving revision 1.156
diff -c -r1.156 datatype.sgml
*** doc/src/sgml/datatype.sgml	13 Mar 2005 09:36:30 -0000	1.156
--- doc/src/sgml/datatype.sgml	30 Apr 2005 23:57:51 -0000
***************
*** 503,511 ****
      <para>
       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 <type>numeric</>
!      type is more akin to <type>varchar(<replaceable>n</>)</type>
!      than to <type>char(<replaceable>n</>)</type>.)
      </para>
  
      <para>
--- 503,513 ----
      <para>
       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, so each numeric needs eight
!      bytes in headers and two bytes for each four decimal digits actually
!      stored.  (In this sense the <type>numeric</> type is more akin to
!      <type>varchar(<replaceable>n</>)</type> than to
!      <type>char(<replaceable>n</>)</type>.)
      </para>
  
      <para>

---

From: Tom Lane <[email-masked]>
Date: Sun, 01 May 2005 11:55:26 -0400

> Please find a patch per IRC chat yesterday that clarifies how much

Applied with minor editorialization.

			regards, tom lane