Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jonasbn (1153)

jonasbn
  reversethis-{gro.napc} {ta} {nbsanoj}
http://e-diot.dk/
AOL IM: BJonasN (Add Buddy, Send Message)

Perl Programmer located in Copenhagen, Denmark. Active member of Copenhagen Perl Mongers.

Author of:

  • Business::DK::CPR
  • Business::DK::CVR
  • Business::DK::PO
  • Business::OnlinePayment::CashCow
  • Date::Holidays
  • Date::Holidays::Abstract
  • Date::Holidays::Super
  • Date::Pregnancy
  • Games::Bingo
  • Games::Bingo::Bot
  • Games::Bingo::Print
  • Module::Info::File
  • Module::Template::Setup
  • Test::Timer

and maintainer of:

  • Tie::Tools
  • XML::Conf
  • Workflow

Journal of jonasbn (1153)

Wednesday June 21, 2006
07:29 AM

SQL-Ledger Backup Warning

[ #29990 ]

I had a second go at moving all my accounting from my TiBook to my sleepless Powerbook yesterday.

The first attempt seemed to had gone quite ok, but the moment I started doing accounting things started acting really weird.

What I did was;

  • I made a backup of the PostgreSQL DB
  • I updated the SQL-Ledger installation on the TiBook to the latest version
  • I installed the latest version on the new Powerbook
  • I made a new backup of the PostgreSQL DB on the updated Powerbook
  • I imported the backup onto the installation on the Powerbook

Everything looked ok, even some of the trouble I had experienced with rounding and currencies seemed to go away with little effort.

But then some of the new posts started so show wrong data and some of the balances looked weird...

The problem is simply that the backup you can perform from inside SQL-Ledger. I have not investigated whether it is just a wrapper for pg_dump or whether pg_dump creates the same result, does not seem to be in balance with the value of it's sequences


The sequence:

logicLAB=# select * from id;
sequence_name | last_value | increment_by | max_value |
min_value | cache_value | log_cnt | is_cycled | is_called
---------------+------------+--------------+---------------------
+-----------+-------------+---------+-----------+-----------
id | 10076 | 1 | 9223372036854775807
| 1 | 1 | 0 | f | t
(1 row)

The maximum trans_id from acc_trans:

logicLAB=# select max(trans_id) from acc_trans;
      max
-------
10994
(1 row)

logicLAB=#

But anyway the sequences set by the dump where not aligned with the actual data also in the dump, meaning you would overwrite some transactions, loosing data...

Not good, I have now manually set the seq, to a high value, this is just a heads-up for any possible SQL-Ledger users out there.

I will have to investigate the state of the installation on the TiBook at some point.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.