Search Postgresql Archives

Re: pg_restore man page question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 7, 2016 at 10:17 AM, Karsten Hilbert <Karsten.Hilbert@xxxxxxx> 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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux