Discussion:
pg_dump/pg_restore
(too old to reply)
Alexey Bobkov
2004-01-12 11:45:16 UTC
Permalink
PostgreSQL 7.3.2

I have been dumping my database with next options:
pg_dump -f /path_to_database/backup/db_backup.file -Z 9 database_name
and get db_backup.file file.

Then a try to restore my data:
pg_restore /path_to_database/backup/db_backup.file
and get next error
pg_restore: [archiver] input file does not appear to be a valid archive

I think it's because in pg_dump, I not set -F c option :(

How I can restore this broken file?

Thanks




---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
Tom Lane
2004-01-12 14:46:58 UTC
Permalink
Post by Alexey Bobkov
pg_dump -f /path_to_database/backup/db_backup.file -Z 9 database_name
and get db_backup.file file.
This is giving you a plain SQL-script dump file. To restore, feed it
into psql.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html
Alexey Bobkov
2004-01-12 15:01:49 UTC
Permalink
Post by Tom Lane
Post by Alexey Bobkov
pg_dump -f /path_to_database/backup/db_backup.file -Z 9 database_name
and get db_backup.file file.
This is giving you a plain SQL-script dump file. To restore, feed it
into psql.
No :)
this is giving me gzip compressed file
I found solution for my problem.
This is step by step instruction for me :)

mv db_backup.file db_backup.file.gz
gzip -g db_backup.file.gz

:)

thanks
--
Alexey Bobkov
e-Style ISP
tel/fax +7 095 7969797


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html
Sai Hertz And Control Systems
2004-01-12 16:17:08 UTC
Permalink
Dear Alexey Bobkov ,
Post by Alexey Bobkov
pg_restore /path_to_database/backup/db_backup.file
and get next error
pg_restore: [archiver] input file does not appear to be a valid archive
Use psql instead with command
psql -U username databasename -f yourdb_file.sql
Yes you will have to edit the file a bit.
Drawbacks are :
triggers will go of on all insert and will be stumbling block in case to
dump you may use the following command in future

pg_dump --disable-triggers -U <user_name> -a -d -b -D -Fc -Z 9 -f
<filername.tar.gz> <dbname>
and to restore use
pg_restore --disable-triggers -U <user_name> -d <dbname>
<backupfilename.tar.gz>

Regards,
Vishal Kashyap

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ***@postgresql.org)
John Siracusa
2004-01-12 16:29:52 UTC
Permalink
Post by Sai Hertz And Control Systems
Dear Alexey Bobkov ,
Post by Alexey Bobkov
pg_restore /path_to_database/backup/db_backup.file
and get next error
pg_restore: [archiver] input file does not appear to be a valid archive
Use psql instead with command
psql -U username databasename -f yourdb_file.sql
Yes you will have to edit the file a bit.
triggers will go of on all insert and will be stumbling block
Is this true when dumping using pg_dumpall and restoring by piping to psql?
Are triggers going off during the restore? I don't see a --disable-triggers
option to pg_dumpall.

-John


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Loading...