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@sss.pgh.pa.u To: "John-Paul Delaney" <John-Paul.Delaney@wfp.org>
s> cc: pgsql-novice@postgresql.org
Subject: Re: [NOVICE] pg_ [dump & restore] invalid archive
04/11/2004 16:17 problem
"John-Paul Delaney" <John-Paul.Delaney@wfp.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