pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: juanmime@ono.com
To: pgsql-admin@postgresql.org
Subject: Asunto: Re: pg_restore usage
Date: Tue, 29 Jun 2004 18:56:53 +0200
Message-ID: <40D7955200003EA9@resmta03.ono.com> (raw)
In-Reply-To: <11767.1088346148@sss.pgh.pa.us>

>tfo@alumni.brown.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.




Message-ID: <40D7955200003EA9@resmta03.ono.com>
Permalink:  ../40D7955200003EA9@resmta03.ono.com/
Also on:    postgresql.org/message-id/40D7955200003EA9@resmta03.ono.com

 · 

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: juanmime@ono.com
  Subject: Re: Asunto: Re: pg_restore usage
  In-Reply-To: <40D7955200003EA9@resmta03.ono.com>
  References: <11767.1088346148@sss.pgh.pa.us> <40D7955200003EA9@resmta03.ono.com>

* 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