pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Eli Mesika <emesika@redhat.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7792: pg_dump does not treat -c flag correctly when using tar format
Date: Mon, 7 Jan 2013 04:08:23 -0500 (EST)
Message-ID: <938821469.1644658.1357549703303.JavaMail.root@redhat.com> (raw)
In-Reply-To: <10105.1357518726@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>



----- Original Message -----
> From: "Tom Lane" <tgl@sss.pgh.pa.us>
> To: emesika@redhat.com
> Cc: pgsql-bugs@postgresql.org
> Sent: Monday, January 7, 2013 2:32:06 AM
> Subject: Re: [BUGS] BUG #7792: pg_dump does not treat -c flag correctly when using tar format
> 
> 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.

Tom, thanks for the quick respond.
I find that very confusing:
Currently, in order to use the pg_restore (tar format), you will have to create first the database with the same schema you are going to restore while the most convenient usage is to create a new empty database and run the restore. 
Also, that contradict with the pg_dump -C flag that adds database creation statement and it is clear that DROP statements will fail on a clean database.

Regards
Eli



> 
> 			regards, tom lane
> 


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (6+ messages)  latest in thread

Message-ID: <938821469.1644658.1357549703303.JavaMail.root@redhat.com>
Permalink:  ../938821469.1644658.1357549703303.JavaMail.root@redhat.com/
Also on:    postgresql.org/message-id/938821469.1644658.1357549703303.JavaMail.root@redhat.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: emesika@redhat.com, tgl@sss.pgh.pa.us
  Subject: Re: BUG #7792: pg_dump does not treat -c flag correctly when using tar format
  In-Reply-To: <938821469.1644658.1357549703303.JavaMail.root@redhat.com>
  References: <10105.1357518726@sss.pgh.pa.us> <938821469.1644658.1357549703303.JavaMail.root@redhat.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox