Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: probable faq: internal format of numerics



Tom Lane wrote:
Brian Hurt <bhurt(at)janestcapital(dot)com> writes:
  
This is probably a FAQ, but I've googled the question and haven't found 
an answer.  What is the internal format of  numerics?
    

"Use the source, Luke"

  

This is what I was hoping to not do.  It's generally not possible to understand a peice of a project out of context- even well commented and well structured code like the Postgres code looks to be.

That said, it looks like they're doing a variant of my #2- they're holding 5 decimal digits every 2 bytes, plus an extra byte or so for the sign.  But consider the NumericVar structure defined in numeric.c- is one of those stored with every row of a table, or are most of the values stored once per table and only the digits stored in the row?  >From a cursory reading of the code, it's hard for me to tell.

Brian



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group