bug in pg_restore - Mailing list pgsql-general

From Jeffrey W. Baker
Subject bug in pg_restore
Date
Msg-id 1011396526.19728.6.camel@heat
Whole thread Raw
Responses Re: bug in pg_restore  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
I think there is a little bug in pg_restore.  It says it can't restore
because the database doesn't exist, but then if I create the database it
says it can't proceed because the database DOES exist.  The solution for
me was to omit the -C argument, but it looks like a bug to me:

pg@carlito:/bigraid/tmp$ pg_restore -C -F custom -d rupert -v rupert.dump
pg_restore: connecting to database for restore
pg_restore: [archiver (db)] connection to database "rupert" failed: FATAL 1:  Database "rupert" does not exist in the
systemcatalog. 
pg_restore: *** aborted because of error
pg@carlito:/bigraid/tmp$ createdb rupert
CREATE DATABASE
pg@carlito:/bigraid/tmp$ pg_restore -C -F custom -d rupert -v rupert.dump
pg_restore: connecting to database for restore
pg_restore: creating DATABASE rupert
pg_restore: [archiver (db)] could not execute query: ERROR:  CREATE DATABASE: database "rupert" already exists
pg_restore: *** aborted because of error
pg@carlito:/bigraid/tmp$ pg_restore -F custom -d rupert -v rupert.dump
pg_restore: connecting to database for restore
pg_restore: creating SEQUENCE request_id
...


The dump file was created with the -C argument.

Regards,
Jeffrey


pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Need book on PHP and PostgreSQL
Next
From: Stephan Szabo
Date:
Subject: Re: bug in pg_restore