Re: [GENERAL] Would you add a --dry-run to pg_restore?

Поиск
Список
Период
Сортировка
От Francisco Olarte
Тема Re: [GENERAL] Would you add a --dry-run to pg_restore?
Дата
Msg-id CA+bJJbxszmt7Pd8Xfrp2QFGbvQHLQ=aX2iomzO=S37D=JtG_=Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [GENERAL] Would you add a --dry-run to pg_restore?  (Edmundo Robles <edmundo@sw-argos.com>)
Список pgsql-general
On Wed, Aug 2, 2017 at 7:10 PM, Edmundo Robles <edmundo@sw-argos.com> wrote:
>
> I  imagine   pg_restore can  execute  the instructions on dump but  don't  write on disk.   just like David said:
"tellme what is going to happen but don't actually do it" 


IIRC pg_restore does not execute SQL fully. It just passes the
commands to the server when in text mode, like psql, and builds some
commands and send them to the server to execute when in custom/tar
mode. I doubt it has the ability to validate the contents of the dump.

>> Edmundo Robles <edmundo@sw-argos.com> writes:
>> > I mean,  to   verify the integrity of backup  i do:
>> > gunzip -c backup_yesterday.gz | pg_restore  -d my_database  && echo
>> > "backup_yesterday is OK"

I also think if he is piping the dump must be text mode, I seem to
recall custom format needs seekable files, but not too sure about tar,
it should not. In this case, as previously suggested, a simple gunzip
-t is enough to verify backup file integrity, but checking internal
correctness is very difficult ( as it may even depend on server
configuration, i.e., needing some predefined users / locales /
encodings ).

Francisco Olarte.


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

Предыдущее
От: Francisco Olarte
Дата:
Сообщение: Re: [GENERAL] Do not INSERT if UPDATE fails
Следующее
От: Rory Campbell-Lange
Дата:
Сообщение: Re: [GENERAL] Would you add a --dry-run to pg_restore?