public inbox for [email protected]
help / color / mirror / Atom feedFrom: David Fetter <[email protected]>
To: PostgreSQL Docs <[email protected]>
Subject: Storage requirements for NUMERIC
Date: Sat, 30 Apr 2005 17:03:36 -0700
Message-ID: <[email protected]> (raw)
Folks,
Please find a patch per IRC chat yesterday that clarifies how much
space a NUMERIC takes.
Cheers,
D
--
David Fetter [email protected] 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>
Attachments:
[text/plain] numeric_storage.diff (1.3K, 2-numeric_storage.diff)
download | inline diff:
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>
view thread (2+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: Storage requirements for NUMERIC
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox