Asunto: Re: pg_restore usage

From: juanmime(at)ono(dot)com
To: pgsql-admin(at)postgresql(dot)org
Subject: Asunto: Re: pg_restore usage
Date: 2004-06-29 16:56:53
Message-ID: 40D7955200003EA9@resmta03.ono.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

>tfo(at)alumni(dot)brown(dot)edu (Thomas F. O'Connell) writes:
>> I transfer this file to another server, where the database db does not
>> exist. I try the following:
>
>> pg_restore -C -d db pg_dump20040621.pgsql
>> pg_restore: [archiver (db)] connection to database "db" failed: FATAL:
>> database "db" does not exist
>
>> What is an example of how the -C flag is intended to be used?
>
>Whatever database you name in -d has to already exist, because that's
>where pg_restore will initially connect. -C means to issue a CREATE
>DATABASE command and then reconnect to the new db.
>
>In other words, try "-C -d template1".
>

I have a database called "test", that I use for proofs, and It also is usefull
for restoring a database.

Realize that psql and pg_restore, need to connect to a database. Therefore
I use the "test" database for these issues. I prefer "test", than "template1",
because If I make an mistake, then it would not affect all databases based
in the template.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Werner Bohl 2004-06-29 17:09:29 Stopping vacuum
Previous Message Lamar Owen 2004-06-29 16:50:06 Re: Binary/source for 7.4.3