Re: pg_restore man page question

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: pg_restore man page question
Дата
Msg-id CAKFQuwZLGKE3Q2fn9t8Dded2WJK20T37A4YHHXJSBgyoUdv2hQ@mail.gmail.com
обсуждение исходный текст
Ответ на pg_restore man page question  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Ответы Re: pg_restore man page question  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Список pgsql-general
On Mon, Mar 7, 2016 at 10:17 AM, Karsten Hilbert <Karsten.Hilbert@gmx.net> wrote:
The man page of pg_restore says

        --disable-triggers
                This option is relevant only when performing a
                data-only restore. It instructs pg_restore to execute
                commands to temporarily disable triggers on the
                target tables while the data is reloaded. [...]

This hint seems overly narrow: when doing a restore of schema
PLUS data (IOW, not a schema-only restore) it should apply,
too, shouldn't it ?

Otherwise it would suggest that pg_restore does this:

- restore basic table structure
- restore data
- restore constraints and triggers and ...

... ​indexes​
 

​Why is the surprising?  When restoring everything it is able to "cheat" since it knows that what it is restoring is a self-consistent state of being and as such there is no need or desire to fire triggers, check constraints, or maintain indexes, as the data is being loaded.  I'm not positive on the exact mechanics but observation and Josh's comment cross-thread support this explanation.

It can be readily checked by passing the --list option to pg_restore.

David J.

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

Предыдущее
От: Geoff Winkless
Дата:
Сообщение: Re: index problems (again)
Следующее
От: Karsten Hilbert
Дата:
Сообщение: Re: pg_restore man page question