Re: pg_restore ignores -C when using a restore list -L

From: Russell Smith <mr-russ(at)pws(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: pg_restore ignores -C when using a restore list -L
Date: 2010-05-15 09:19:01
Message-ID: 4BEE6705.1060902@pws.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 15/05/10 03:26, Tom Lane wrote:
> Russell Smith <mr-russ(at)pws(dot)com(dot)au> writes:
>
>>> By the operation of other items (-C --data-only) passed with -l, it only
>>> produces to contents that would be restored with the other switches
>>> provided. If that's expect behavior, then the documentation of the
>>> switch is incorrect and should read something more like
>>>
>>> -l
>>> --list List the items in the archive that would be restored
>>> taking into account any other switches provided. The output of this
>>> operation can be used with the -L option to further restrict and
>>> reorder the items that are restored.
>>>
> Yeah, -l is limited by other filtering switches, and this definitely
> ought to be stated more clearly in the documentation. (The content
> of the produced file implies it, since it says *Selected* TOC Entries,
> but that's hardly clear enough.)
>
>
>> Further to these comments, both scenarios should make -l or -L
>> incompatibe with -C --data-only -I -n --schema-only -T -t -x as all
>> these alter the contents of what is restored. You should either use the
>> list to control the items restored or the switches. Using both just
>> created confusion.
>>
> I believe that allowing the filter switches to act on -l is a useful
> behavior, and anyway it's been like that for many years and nobody's
> complained before. So I'm not excited about taking out the
> functionality.
>
> However, I think -C is a special case because it's quite un-obvious
> to the user that it effectively acts as a filter switch --- in fact a
> de-filtering switch, because the lack of -C is what filters out the
> DATABASE item.
>
> I'm inclined to think that we should document that the output of -l
> is restricted by -n and similar switches, but change the code so that
> -C doesn't affect -l output. Comments?
>
Sounds good. -L could do with some man page help as well;

--use-list=list-file
Restore elements in list-file only, and in the order
they appear in the file. Lines can be moved and can also be commented out by
placing a ; at the start of the line. (See below for
examples.)

That indicates that "list-file only" lacks clarity when you can further
restrict with command line parameters.

Thanks

Russell

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Ben Hockey 2010-05-16 05:53:44 Re: BUG #3563: DATESTYLE feature suggestion
Previous Message Rumko 2010-05-14 20:08:41 Re: Giant TOAST tables due to many almost empty pages