Re: pg_restore man page question

From: Melvin Davidson <melvin6925(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_restore man page question
Date: 2016-03-07 20:18:57
Message-ID: CANu8Fiyf0HgAEyOHq+N=nO4AJyFYf=HJp_WN4K9udQTO55wo+Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(dot)klaver(at)aklaver(dot)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(dot)klaver(at)aklaver(dot)com
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2016-03-07 20:23:12 Re: index problems (again)
Previous Message Francisco Olarte 2016-03-07 19:11:48 Re: multiple UNIQUE indices for FK