Re: BUG #7792: pg_dump does not treat -c flag correctly when using tar format - Mailing list pgsql-bugs

From Magnus Hagander
Subject Re: BUG #7792: pg_dump does not treat -c flag correctly when using tar format
Date
Msg-id CABUevExd-TvbkBN1JnHsGZovGntsvGPznah7Vz=xgRrftkuWkQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #7792: pg_dump does not treat -c flag correctly when using tar format  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #7792: pg_dump does not treat -c flag correctly when using tar format
List pgsql-bugs
On Mon, Jan 7, 2013 at 1:32 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> emesika@redhat.com writes:
>> 1) pg_dump -F t -U postgres -f test.tar test
>> 2) tar xvf test.tar  to any directory
>> 3) vi restore.sql
>> * restore.sql includes DROP statements for each object even tough -c flag
>> was not given
>
> I believe this is intentional - at least, pg_backup_tar.c goes out of
> its way to make it happen.  (The forcible setting of ropt->dropSchema
> in _CloseArchive is the cause, and it's hard to see why that would be
> there unless the author intended this effect.)  Perhaps we should remove
> that, but it would be an incompatible change.  Arguing for or against
> it really requires a model of what people would be doing with the
> restore.sql script.  I'm not entirely convinced that it should be
> considered equivalent to what you'd get from a plain dump run.

tar archives are more like custom archives ,arne't they? The idea
being that since you use pg_restore to restore them, you should use -c
on the pg_restore commandline, and not on the pg_dump one? And if we
didn't include it in the dump, that wouldn't even be possible.

I definitely think it's doing the right thing, but perhaps it's
something that needs to be clarified in the documentation if people
find it confusing.

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

pgsql-bugs by date:

Previous
From: Dave Page
Date:
Subject: Re: BUG #7781: pgagent incorrect installation
Next
From: lars@greiz-reinsdorf.de
Date:
Subject: BUG #7798: Query in a rule does not see committed transaction