Be advised, the --section option is only available from 9.2 and up.

On Mon, Mar 7, 2016 at 2:08 PM, Adrian Klaver <adrian.kla...@aklaver.com>
wrote:

> 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.kla...@aklaver.com
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>



-- 
*Melvin Davidson*
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.

Reply via email to