Using an externally hosted postGreSQL as a gnu cash backend?

Geert Janssens geert.gnucash at kobaltwit.be
Tue Apr 12 06:57:38 EDT 2016


On Tuesday 12 April 2016 12:38:33 Plutocrat wrote:
> Michael Wagner wrote on Tuesday, 12 April, 2016 06:39 AM:
> > So gnucash doesn't update the PostGres DB using transaction
> > semantics? That's interesting - not doubting you, that just seems
> > odd.
> 
> I think the point he was making was that whatever db backend you use
> -- XML, sqlite, MySQL, Postgresql -- the way Gnucash works is to read
> the whole data from the database when it starts up, and only writes
> it back when you hit save. So as data is not being constantly written
> to Postgresql, it's not really any more reliable than XML.
> 
No, this is not correct.

As Colin already writes, the database backend will write each change to the database 
immediately. There is never a need to explicitly save the data (unless you want to convert it 
to another database or xml file).

The other part in Colin's reply is also correct: gnucash reads the entire database in memory at 
start up and won't read it again afterwards. So if someone alters it outside of the running 
gnucash instance (including from another gnucash instance) these writes may conflict. In the 
best case you have duplicate data, in the worst case you may end up with a corrupt database. 
I'm not sure. As concurrent database writes are not supported the behavior in such a situation 
hasn't been tested.

Regards,

Geert


More information about the gnucash-user mailing list