Re: pg_ [dump & restore] invalid archive problem
От | Tom Lane |
---|---|
Тема | Re: pg_ [dump & restore] invalid archive problem |
Дата | |
Msg-id | 25466.1099581448@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | pg_ [dump & restore] invalid archive problem ("John-Paul Delaney" <John-Paul.Delaney@wfp.org>) |
Список | pgsql-novice |
"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
В списке pgsql-novice по дате отправления: