Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)

Поиск
Список
Период
Сортировка
От Ken Tanzer
Тема Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)
Дата
Msg-id CAD3a31VuTCM2x2=guZahDcz=zvWyiaORR+BoiWE7tUcAKXURtg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [GENERAL] Help with restoring a dump in Tar format? (dependencies/ordering)
Список pgsql-general
> So I can switch to Custom format for future backups.  But regarding the
> existing backups I have in Tar format, is there any way to successfully
> restore them?

FWIW, the business with making and editing a list file should work just
fine with a tar-format dump, not only with a custom-format dump.  The
metadata is all there in either case.

I had tried that originally, but got an error:

bash-4.1$ pg_restore -L spc_restore_list.tmp -d spc_test_1 agency_backup.spc.2017.06.05_10.30.01.tar 

pg_restore: [tar archiver] restoring data out of order is not supported in this archive format: "10608.dat" is required, but comes before "10760.dat" in the archive file.

The pg_dump doc page kinda suggests but doesn't quite say that you can't re-order tar files; between that and the error message I gave up on that possibility.  Are you suggesting it should work?

The alternative archive file formats must be used with pg_restore to rebuild the database. They allow pg_restore to be selective about what is restored, or even to reorder the items prior to being restored. The archive file formats are designed to be portable across architectures.

When used with one of the archive file formats and combined with pg_restorepg_dump provides a flexible archival and transfer mechanism. pg_dump can be used to backup an entire database, then pg_restore can be used to examine the archive and/or select which parts of the database are to be restored. The most flexible output file formats are the "custom" format (-Fc) and the "directory" format(-Fd). They allow for selection and reordering of all archived items, support parallel restoration, and are compressed by default. The "directory" format is the only format that supports parallel dumps.

Cheers,
Ken
--
AGENCY Software  
A Free Software data system
By and for non-profits
(253) 245-3801

learn more about AGENCY or
follow the discussion.

В списке pgsql-general по дате отправления:

Предыдущее
От: Garry Sim
Дата:
Сообщение: Re: [GENERAL] Unable to install EASM postgre due to error 8023
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: [GENERAL] Help with restoring a dump in Tar format?(dependencies/ordering)