State of Postgres support, and/or command line interface?

Klaus Dahlke klaus.dahlke at gmx.de
Sat May 19 06:05:33 EDT 2007


On Fri, 18 May 2007 19:38:05 -0400 (EDT)
"Josh Sled" <jsled at asynchronous.org> wrote:


> > That would probably work out perfectly for my purposes.... willing to
> > share?  I'd certainly be willing to return any enhancements I may make..
> > although I doubt I'd need to make any..
> 
> Yeah, it's be great to have that script available, maybe even in a
> contrib/ directory in the 2.2 release.
> 

Hi all, please find attached three files:
1) gnctables.sql: creates the old gnucash relevant tables in an existing database. Please set the user accordingly in the script first and please be aware that the new features like customers, scheduled transaction etc are not represented by the table structure. But for reporting purposes the table structure is good enough.

2) gnc2sql.pl: script for initial data load. Please check line 35 for the proper file name for the gnucash zipped xml file, check line 68 for connecting to the database.

3) gnc2sql_update.sql: script for delta load. Unfortunately, it has to read the entire xml-file, but posts only the transactions since last upload/delta-upload. As above check line 39 for the file where the date of last upload is stored, check line 49 for the gnucash-file and check line 81 for connecting to the database. This script doesn't create new accounts or new commodities as neither of the tables have a date filed. You have to do that 'by hand' by evaluating the accountguid of a split. My assumption is that having new accounts and new commodities is not so often that doing it manually is sufficient. If the delta upload fails for what reason ever, you may delete the content of all tables and just run the initial load script (gnc2sql.pl) again.

Have fun,
Klaus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gnc2sql.pl
Type: application/x-perl
Size: 8691 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-user/attachments/20070519/adeb48a8/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gnc2sql_update.pl
Type: application/x-perl
Size: 6581 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-user/attachments/20070519/adeb48a8/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gnctables.sql
Type: text/x-sql
Size: 21578 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-user/attachments/20070519/adeb48a8/attachment-0002.bin 


More information about the gnucash-user mailing list