From: Stan W. <st...@ba...> - 2007-11-29 19:48:11
|
Hi. I'm using Sql-Ledger 2.8.8 and Postgres 8.1.9. Every night I do a = database dump using the following command: pg_dump dataset =96U username | gzip > filename.gz Today I dropped my database then recreated it in Sql-Ledger Administration. When I try to resore the database using to following: psql dataset =96U username < input file name I get the following errors: [root@bacstx ~]# psql bayarea -U sql-ledger < bayareadb SET SET SET ERROR: must be owner of schema public ERROR: must be superuser to create procedural language SET CREATE FUNCTION ALTER FUNCTION SET SET ERROR: relation "acc_trans" already exists ALTER TABLE ERROR: relation "addressid" already exists ALTER TABLE setval -------- 155 (1 row) ERROR: relation "address" already exists ALTER TABLE ERROR: relation "id" already exists ALTER TABLE setval -------- 11054 (1 row) ERROR: relation "ap" already exists ALTER TABLE ERROR: relation "ar" already exists ALTER TABLE ERROR: relation "assemblyid" already exists ALTER TABLE setval -------- 16 (1 row).............. ERROR: duplicate key violates unique constraint "curr_pkey" CONTEXT: COPY curr, line 1: "1 USD 2" ERROR: multiple primary keys for table "address" are not allowed ERROR: multiple primary keys for table "br" are not allowed ERROR: multiple primary keys for table "contact" are not allowed ERROR: multiple primary keys for table "curr" are not allowed ERROR: multiple primary keys for table "customer" are not allowed ERROR: multiple primary keys for table "paymentmethod" are not allowed ERROR: multiple primary keys for table "vendor" are not allowed ERROR: relation "acc_trans_chart_id_key" already exists ERROR: relation "acc_trans_source_key" already exists ERROR: relation "acc_trans_trans_id_key" already exists ERROR: relation "acc_trans_transdate_key" already exists ERROR: relation "ap_employee_id_key" already exists ERROR: relation "ap_id_key" already exists ERROR: relation "ap_invnumber_key" already exists ERROR: relation "ap_ordnumber_key" already exists ERROR: relation "ap_quonumber_key" already exists ERROR: relation "ap_transdate_key" already exists ERROR: relation "ap_vendor_id_key" already exists ERROR: relation "ar_customer_id_key" already exists ERROR: relation "ar_employee_id_key" already exists ERROR: relation "ar_id_key" already exists ERROR: relation "ar_invnumber_key" already exists ERROR: relation "ar_ordnumber_key" already exists ERROR: relation "ar_quonumber_key" already exists ERROR: relation "ar_transdate_key" already exists ERROR: relation "assembly_id_key" already exists ERROR: relation "audittrail_trans_id_key" already exists ERROR: relation "cargo_id_key" already exists ERROR: relation "chart_accno_key" already exists ERROR: relation "chart_category_key" already exists ERROR: relation "chart_gifi_accno_key" already exists ERROR: relation "chart_id_key" already exists ERROR: relation "chart_link_key" already exists ERROR: relation "customer_contact_key" already exists ERROR: relation "customer_customer_id_key" already exists ERROR: relation "customer_customernumber_key" already exists ERROR: relation "customer_name_key" already exists ERROR: relation "department_id_key" already exists ERROR: relation "employee_id_key" already exists ERROR: relation "employee_login_key" already exists ERROR: relation "employee_name_key" already exists ERROR: relation "exchangerate_ct_key" already exists ERROR: relation "gifi_accno_key" already exists ERROR: relation "gl_description_key" already exists ERROR: relation "gl_employee_id_key" already exists ERROR: relation "gl_id_key" already exists ERROR: relation "gl_reference_key" already exists ERROR: relation "gl_transdate_key" already exists ERROR: relation "inventory_parts_id_key" already exists ERROR: relation "invoice_id_key" already exists ERROR: relation "invoice_trans_id_key" already exists ERROR: relation "jcitems_id_key" already exists ERROR: relation "language_code_key" already exists ERROR: relation "makemodel_make_key" already exists ERROR: relation "makemodel_model_key" already exists ERROR: relation "makemodel_parts_id_key" already exists ERROR: relation "oe_employee_id_key" already exists ERROR: relation "oe_id_key" already exists ERROR: relation "oe_ordnumber_key" already exists ERROR: relation "oe_transdate_key" already exists ERROR: relation "orderitems_trans_id_key" already exists ERROR: relation "parts_description_key" already exists ERROR: relation "parts_id_key" already exists ERROR: relation "parts_partnumber_key" already exists ERROR: relation "partscustomer_customer_id_key" already exists ERROR: relation "partscustomer_parts_id_key" already exists ERROR: relation "partsgroup_id_key" already exists ERROR: relation "partsgroup_key" already exists ERROR: relation "partstax_parts_id_key" already exists ERROR: relation "partsvendor_parts_id_key" already exists ERROR: relation "partsvendor_vendor_id_key" already exists ERROR: relation "pricegroup_id_key" already exists ERROR: relation "pricegroup_pricegroup_key" already exists ERROR: relation "project_id_key" already exists ERROR: relation "projectnumber_key" already exists ERROR: relation "shipto_trans_id_key" already exists ERROR: relation "status_trans_id_key" already exists ERROR: relation "translation_trans_id_key" already exists ERROR: relation "vendor_contact_key" already exists ERROR: relation "vendor_name_key" already exists ERROR: relation "vendor_vendornumber_key" already exists ERROR: relation "vendortax_vendor_id_key" already exists ERROR: constraint "vr_br_id_fkey" for relation "vr" already exists WARNING: no privileges could be revoked REVOKE WARNING: no privileges could be revoked REVOKE WARNING: no privileges were granted GRANT WARNING: no privileges were granted GRANT Complete errors attached as a text file Can anyone help? Thanks, Stan Williams -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: dberrors.txt |
From: Dieter S. <dsi...@sq...> - 2007-11-29 20:18:34
|
> Hi. > > I'm using Sql-Ledger 2.8.8 and Postgres 8.1.9. Every night I do a > database dump using the following command: > > pg_dump dataset U username | gzip > filename.gz > > Today I dropped my database then recreated it in Sql-Ledger Administration. > > When I try to resore the database using to following: > > psql dataset U username < input file name > > I get the following errors: You cannot restore a database over top of an already existing. drop the database then create a blank one and restore. |
From: Stuart L. <sl...@cc...> - 2007-11-30 01:34:14
|
On 木, 2007-11-29 at 13:52 -0600, Stan Williams wrote: > Hi. > > I'm using Sql-Ledger 2.8.8 and Postgres 8.1.9. Every night I do a > database dump using the following command: > > pg_dump dataset –U username | gzip > filename.gz > > Today I dropped my database then recreated it in Sql-Ledger Administration. > > When I try to resore the database using to following: > > psql dataset –U username < input file name I believe that if you're using pg_dump for the backup, you should use pg_restore to restore it. I'm doing something like this: pg_dump -F t databasename > backupfile for the backup, and this: pg_restore -c -U sql-ledger -d databasename -F t backupfile I have found that you need the -c in there to wipe out the old database so you don't get those annoying ``already exists'' messages. -- Stuart Luppescu -=- s-luppescu .at. uchicago.edu University of Chicago (^_^)/ CCSR 才文と智奈美の父 -=-=- Kernel 2.6.20-gentoo-r It takes a special kind of courage to face what we all have to face. |
From: Bob G. <bo...@rc...> - 2007-12-01 16:08:40
|
On Nov 29, 2007, at 19:34, Stuart Luppescu wrote: > On =E6=9C=A8, 2007-11-29 at 13:52 -0600, Stan Williams wrote: >> Hi. >> >> I'm using Sql-Ledger 2.8.8 and Postgres 8.1.9. Every night I do a >> database dump using the following command: >> >> pg_dump dataset =E2=80=93U username | gzip > filename.gz >> >> Today I dropped my database then recreated it in Sql-Ledger =20 >> Administration. >> >> When I try to resore the database using to following: >> >> psql dataset =E2=80=93U username < input file name > > I believe that if you're using pg_dump for the backup, you should use > pg_restore to restore it. I'm doing something like this: > > pg_dump -F t databasename > backupfile > > for the backup, and this: > > pg_restore -c -U sql-ledger -d databasename -F t backupfile > > I have found that you need the -c in there to wipe out the old =20 > database > so you don't get those annoying ``already exists'' messages. > > --=20 > Stuart Luppescu -=3D- s-luppescu .at. uchicago.edu > University of Chicago (^_^)/ CCSR > =E6=89=8D=E6=96=87=E3=81=A8=E6=99=BA=E5=A5=88=E7=BE=8E=E3=81=AE=E7=88=B6= -=3D-=3D- Kernel 2.6.20-gentoo-r > It takes a special kind of courage to face what we > all have to face. > If the other fixes mentioned have not solved the problem, you might =20 change your user to 'postgres' before executing the restore command. =20 As in: [root@bacstx ~]# su postgres [postgres@bacstx user]# psql bayarea < bayareadb The prompt on this last line might look different as bash-3.2$ This depends on your operating system and the preferences you have =20 chosen. If you do: [root@bacstx ~]# su - postgres You will get thrown into the postgres home directory - your backup =20 file is not there.. Have fun Bob G= |