On 11/05/10 16:08, Wallace Roberts Consulting wrote:
The hard drive of my SL server recently died. I thought to myself,
"No worries, I always backup my data." Well, yes, but I did not have
a backup of my SL version, which, at v2.0.8, was quite ancient. I
managed to install the new SL (v2.8.31), but discovered that the
schemas were a bit different. I eventually managed to reconcile my
data with the newer schema,& everything appeared to work correctly.
Reports had the right entries, balances were correct, etc. I thought
I was done.
Then I attempted to add an entry to the GL.
Nothing I did would work. I couldn't edit an existing entry, nor
create a new one. The error was always consistent:
DBD::Pg::db do failed: ERROR: syntax error at end of input
LINE 9: WHERE id =
^ at SL/GL.pm line 178.
Here is the complete command:
UPDATE gl SET
reference = '20100924',
description = 'fuel',
notes = '',
transdate = '2010-09-24',
department_id = 0,
curr = 'USD',
exchangerate = 1
WHERE id =
ERROR: syntax error at end of input
LINE 9: WHERE id =
^
Obviously, the "id" cannot be blank, but I'm stumped as to why it even
would be. Ideas?
Wallace,
'id' is a field that is auto-filled by a sequence named 'id' in
postgresql. At the least, it's used in the gl table and in the chart
table. It is probably elsewhere but I use SL only to manage money; not
to manage a business. It serves as a unique identifier of table entries
and is used to establish relationships between table entries. Please see:
http://www.postgresql.org/docs/current/static/functions-sequence.html
Note the change vis a vis version 8.1; might that apply here?
Every time you create a transaction it calls that sequence (id) and the
next number is given and used by SL. It must be unique. Is there a
chance that the returned id for your new transaction in your new install
is already in use? I would think postgresql would throw up an error but
this might be hidden by the perl code that is doing the actual data
insertion. id is hidden and is not user-available via System --> Defaults
Regards,
r
_______________________________________________
SQL-Ledger mailing list
[email protected]
http://lists.ledger123.com/mailman/listinfo/sql-ledger