pg_dump/pg_restore

Lists: pgsql-admin
From: Alexey Bobkov <bax(at)sunet(dot)ru>
To: pgsql-admin(at)postgresql(dot)org
Subject: pg_dump/pg_restore
Date: 2004-01-12 11:45:16
Message-ID: 400288CC.4050005@sunet.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexey Bobkov <bax(at)sunet(dot)ru>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_dump/pg_restore
Date: 2004-01-12 14:46:58
Message-ID: 28375.1073918818@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Alexey Bobkov <bax(at)sunet(dot)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


From: Alexey Bobkov <bax(at)sunet(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_dump/pg_restore
Date: 2004-01-12 15:01:49
Message-ID: 4002B6DD.6090206@sunet.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Tom Lane wrote:

> Alexey Bobkov <bax(at)sunet(dot)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


From: Sai Hertz And Control Systems <sank89(at)sancharnet(dot)in>
To: Alexey Bobkov <bax(at)sunet(dot)ru>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_dump/pg_restore
Date: 2004-01-12 16:17:08
Message-ID: 4002C884.3080000@sancharnet.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

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


From: John Siracusa <siracusa(at)mindspring(dot)com>
To: Postgres Admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: pg_dump/pg_restore
Date: 2004-01-12 16:29:52
Message-ID: BC2835B0.78BAB%siracusa@mindspring.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

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