Re: Help with pg_restore

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "dan" <dan(at)webfolks(dot)us>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Help with pg_restore
Date: 2003-08-21 14:11:37
Message-ID: 6219.1061475097@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"dan" <dan(at)webfolks(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2003-08-21 14:28:19 Re: pg_dump does not dump index, constraints, sequences
Previous Message Chris Miles 2003-08-21 12:44:19 Re: This table won't use INDEX until I DUMP/RESTORE it ?