pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: dan <dan@webfolks.us>
Cc: pgsql-admin@postgresql.org
Subject: Re: Help with pg_restore
Date: Thu, 21 Aug 2003 10:11:37 -0400
Message-ID: <6219.1061475097@sss.pgh.pa.us> (raw)
In-Reply-To: <20030820202323.25950.qmail@home.mahoneys.us>
References: <20030820202323.25950.qmail@home.mahoneys.us>

"dan" <dan@webfolks.us> writes:
> I created the data directory, then ran initdb to do the intial setup. I next 
> ran:
> cat file1 file2 file3 | pg_restore --clean --create
> It churned for a while and generated a lot of output (file1 and file 2 are 
> just over a gigabyte each, and file3 is about 300 MB). But when I ran psql, 
> none of the tables had been created. What am I doing wrong? 

After some digging in the CVS logs, I came across this post-7.1 fix:

2001-10-23 17:26  tgl

	* src/bin/pg_dump/pg_backup_archiver.c: Forbid the switch
	combination --clean --create, which is pointless (why bother
	dropping individual objects in a just-created database?) as well as
	dangerous (as the code stands, the drops will be issued in the
	wrong database, namely the one you were originally connected to).

which might or might not explain your difficulty.  What I'm currently
suspecting is that pg_restore did restore, but not into the database you
expected it to (I think it would have created a new database of the
original DB name, and restored into that).

			regards, tom lane



view thread (5+ messages)

Message-ID: <6219.1061475097@sss.pgh.pa.us>
Permalink:  ../6219.1061475097@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6219.1061475097@sss.pgh.pa.us

 · 

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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dan@webfolks.us
  Subject: Re: Help with pg_restore
  In-Reply-To: <6219.1061475097@sss.pgh.pa.us>
  References: <20030820202323.25950.qmail@home.mahoneys.us> <6219.1061475097@sss.pgh.pa.us>

* 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