Re: pg_ [dump & restore] invalid archive problem

From: "John-Paul Delaney" <John-Paul(dot)Delaney(at)wfp(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: pg_ [dump & restore] invalid archive problem
Date: 2004-11-04 20:49:25
Message-ID: OF82CE13D3.8F261228-ONC1256F42.00715973-C1256F42.0072A61C@wfp.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Thanks Tom... I'm hoping to move the db from a version 7.3.3 to 7.2.4
though even trying with a format custom 'c' I get the usual error:

pg_restore: [archiver] unsupported version (1.7) in file header

The commands I'm using are:

[On version 7.3.3] pg_dump -Fc -b -i -v mydb > mydb.pg_dump (completes
successfully)

[On version 7.2.4] pg_restore -d mydb -Fc -i -v mydb.pg_dump (immediate
return with error)

/j-p.


Tom Lane
<tgl(at)sss(dot)pgh(dot)pa(dot)u To: "John-Paul Delaney" <John-Paul(dot)Delaney(at)wfp(dot)org>
s> cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: [NOVICE] pg_ [dump & restore] invalid archive
04/11/2004 16:17 problem

"John-Paul Delaney" <John-Paul(dot)Delaney(at)wfp(dot)org> writes:
> Using the command syntax directly from man pg_dump:
> pg_dump -Ft -b mydb > mydb.tar
> pg_restore -d mydb mydb.tar
> I invariably (tried various attempts) get the following error:
> "pg_restore: [archiver] input file does not appear to be a valid archive"

Which PG version are you using? There was a bug for awhile that would
cause pg_restore to fail to identify tar-format archives automatically,
so you had to specify -Ft at restore time too:
pg_restore -Ft -d mydb mydb.tar

Other than that, this looks right to me. The nearby suggestion to use
psql is definitely wrong --- you use psql for plain-text dumps, but
pg_restore for -Ft and -Fc dumps.

(BTW, in general I'd recommend -Fc over -Ft, unless you have some
compelling reason to want to look at the dump with tools other than
pg_restore. The custom-format code is better tested, for one thing, as
evidenced by the fact that this bug went undetected for a good while.)

regards, tom lane

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2004-11-04 21:06:10 Re: pg_ [dump & restore] invalid archive problem
Previous Message Tom Lane 2004-11-04 19:15:19 Re: How to handle a group query