Skip site navigation (1) Skip section navigation (2)

Re: pg_restore usage

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: tfo(at)alumni(dot)brown(dot)edu (Thomas F(dot) O'Connell)
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_restore usage
Date: 2004-06-27 14:22:28
Message-ID: (view raw, whole thread or download thread mbox)
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".

			regards, tom lane

In response to


pgsql-admin by date

Next:From: Tony ReinaDate: 2004-06-27 17:13:54
Subject: Password with libpq
Previous:From: Sanjay AroraDate: 2004-06-27 01:26:28
Subject: Best approach to database design, in this case?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group