pg_restore won't create database

From: "Christopher J(dot) Bottaro" <cjbottaro(at)alumni(dot)cs(dot)utexas(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: pg_restore won't create database
Date: 2005-06-16 15:50:22
Message-ID: d8s6og$9n9$1@sea.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Here's what I'm trying to do:

$ pg_dump -Fc -b -f backup.pgd test_backup_db
$ dropdb test_backup_db
DROP DATABASE
$ pg_restore -C -d test_backup_db backup.pgd
pg_restore: [archiver (db)] connection to database "test_backup_db" failed:
FATAL: database "test_backup_db" does not exist

Here is what the man pages for -C say:

-C
--create
Create the database before restoring into it. (When this option is used,
the database named with -d is used only to issue the initial CREATE
DATABASE command. All data is restored into the database name that appears
in the archive.)

What am I doing wrong? Thank you for the help.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-06-16 16:04:56 Re: pg_restore won't create database
Previous Message Tom Lane 2005-06-16 15:42:01 Re: Autovacuum in the backend