From: Dieter S. <dsi...@sq...> - 2007-01-03 03:04:36
|
Do not edit Pg-tables.sql, it has nothing to do with a backup. Edit the backup file only. -- Dieter Simader http://www.sql-ledger.com Tel: (780) 472-8161 DWS Systems Inc. Accounting Software Fax: (780) 478-5281 ============== On a clear disk you can seek forever ================ On Mon, 1 Jan 2007, Jason Kay wrote: > > You have to edit the backup and adjust the tables as per FAQ and add > > WITH OIDS before you restore. You also have to add a "SELECT > > SETVAL('sequence', sequencenumber);" after the "DROP SEQUENCE" lines > > and remove the "DROP SEQUENCE" lines. > > Thank you Dieter. I did this and it has fixed the problem I had with > printing assemblies. I made a new invoice just now, and when I ran a > report for outstanding invoices for the client, two invoices were > displayed, with the same invoice number, date, total, etc. When I > opened one of them, I noticed that an old inventory item and payment > were added to the invoice along with what I had entered. > > When I was editing the backup file, I had no trouble adding WITH OIDS to > the correct locations, but when I was replacing the DROP SEQUENCE -- > Pg-tables.sqlentries with SELECT SETVAL entries I only had a > 'sequencenumber' for SEQUENCE id. The invoiceid and orderitemsid > SEQUENCES each did not have one: > > ***Snip from backup file: > ... > DROP SEQUENCE id ; > DROP SEQUENCE invoiceid ; > DROP SEQUENCE orderitemsid ; > -- > ... > > ... > -- Pg-tables.sql > CREATE SEQUENCE id start 10000; > SELECT nextval ('id'); > CREATE SEQUENCE invoiceid; > SELECT nextval ('invoiceid'); > CREATE SEQUENCE orderitemsid MAXVALUE 100000 CYCLE; > SELECT nextval ('orderitemsid'); > ... > ***End Snip from backup file. > > I put the following just after the DROP SEQUENCE entries, then deleted > the DROP SEQUENCE entries: > > SELECT SETVAL('id',10000); > SELECT SETVAL('invoiceid'); > SELECT SETVAL('orderitemsid'); > > (So, the SELECT SETVAL entries are still above the '-- Pg-tables.sql' > line.) Is the lack of a 'sequencenumber' for the invoiceid and > orderitemsid SEQUENCES the cause of this problem? If so, how do I > determine what values to put in? > > > Jason Kay. > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > sql-ledger-users mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sql-ledger-users > |