Thread: pg_dump/pg_restore

pg_dump/pg_restore

From
Alexey Bobkov
Date:
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




Re: pg_dump/pg_restore

From
Tom Lane
Date:
Alexey Bobkov <bax@sunet.ru> writes:
> 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.

This is giving you a plain SQL-script dump file.  To restore, feed it
into psql.

            regards, tom lane

Re: pg_dump/pg_restore

From
Alexey Bobkov
Date:
Tom Lane wrote:

> Alexey Bobkov <bax@sunet.ru> writes:
>
>>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.
>
>
> 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


Re: pg_dump/pg_restore

From
Sai Hertz And Control Systems
Date:
Dear Alexey Bobkov ,

>
> 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

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

Re: pg_dump/pg_restore

From
John Siracusa
Date:
On 1/12/04 11:17 AM, Sai Hertz And Control Systems wrote:
> Dear Alexey Bobkov ,
>> 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
>
> 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

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