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

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: emesika(at)redhat(dot)com, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #7792: pg_dump does not treat -c flag correctly when using tar format
Date: 2013-01-07 15:57:54
Message-ID: CABUevExF0OQ+Z4WAjZVJz5D5cacSa9BDT0CDOrzT3fFj1qY-gQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Jan 7, 2013 at 4:41 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>> On Mon, Jan 7, 2013 at 1:32 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> emesika(at)redhat(dot)com writes:
>>>> * 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.
>
> No, pg_restore depends only on what is in the TOC data structure.
> The restore.sql script is just an auxiliary file that's there if you
> extract the contents of the tar file --- pg_restore doesn't use it.

Ah, so it's never used at all? Interesting.

Shows how often I use the tar format :D AFAIK it has no actual
advantage over custom format, but I guess including the restore.sql
file might be considered such an advantage.

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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Ryan Kelly 2013-01-07 17:19:15 Re: BUG #7797: datetime + '1 month'::interval is going outside of a month's bounds
Previous Message Tom Lane 2013-01-07 15:41:25 Re: BUG #7792: pg_dump does not treat -c flag correctly when using tar format