bulk load of historical commodity prices

Stuart McGraw smcg4191 at frii.com
Sat Mar 24 01:13:48 EDT 2012


I have some questions about commodity prices in Gnucash...

I would like to do a bulk load of historical prices for several
stocks and mutual funds.  I am using a Postgresql database and
looking at the price and commodity tables in there, it seems like
it should be pretty straight forward.

First, I know mucking with the database is highly dis-recommended
so rather than asking if I can do this, I'll ask if there are any
specific known reasons why it will break something?

Secondly, I am wondering about the "value_num" and "value_denom"
columns in the "prices" table.  Is it necessary to reduce them 
to reduced fraction form (as they appear to be stored; that is,
$6.22 is stored as value_num=311, value_denom=50), or can I just 
store price*100 in "value_num" and 100 in "value_denom"?  (Just 
out of curiosity, why isn't the value stored as a integer multiple 
of the commodity's "fraction" value?)

Finally, is the "prices.source" value (which contains strings like
"Finance::Quote" and "user:price-editor") used for anything other
than display?  I.e., can I write "user:bulk-load" or similar in 
there?

Thanks for any info.



More information about the gnucash-user mailing list