Re: pg_restore man page question

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_restore man page question
Date: 2016-03-07 19:08:11
Message-ID: 56DDD19B.5000601@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 03/07/2016 10:22 AM, Karsten Hilbert wrote:
> On Mon, Mar 07, 2016 at 11:03:39AM -0700, David G. Johnston 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?
>
> It's not surprising to me. I was making sure which way things
> are because the documentation I consulted wasn't clear on
> that for me. The way things turn out to be -- so much the
> better !

Yeah, you have to dig into one of the switch definitions to get an answer:

http://www.postgresql.org/docs/9.5/interactive/app-pgrestore.html

--section=sectionname

Only restore the named section. The section name can be pre-data,
data, or post-data. This option can be specified more than once to
select multiple sections. The default is to restore all sections.

The data section contains actual table data as well as large-object
definitions. Post-data items consist of definitions of indexes,
triggers, rules and constraints other than validated check constraints.
Pre-data items consist of all other data definition items.

>
> Karsten
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Olarte 2016-03-07 19:11:48 Re: multiple UNIQUE indices for FK
Previous Message Karsten Hilbert 2016-03-07 18:22:09 Re: pg_restore man page question