Re: probable faq: internal format of numerics - Mailing list pgsql-novice

From Brian Hurt
Subject Re: probable faq: internal format of numerics
Date
Msg-id 444E48AC.2060903@janestcapital.com
Whole thread Raw
In response to Re: probable faq: internal format of numerics  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: probable faq: internal format of numerics
List pgsql-novice
Tom Lane wrote:
Brian Hurt <bhurt@janestcapital.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

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: probable faq: internal format of numerics
Next
From: Tom Lane
Date:
Subject: Re: probable faq: internal format of numerics