Re: problem with pg_restore

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexander Cohen <alex(at)toomuchspace(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: problem with pg_restore
Date: 2004-10-05 21:49:58
Message-ID: 18464.1097012998@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alexander Cohen <alex(at)toomuchspace(dot)com> writes:
> pg_restore -d <dbname> -C -v -U <user> <src tar file>

> It keeps on telling me that the database <dbname> does not exist so it
> cant connect to it. I thought the -C flag creates the database, what am
> i missing here?

It does, but you have to connect somewhere first so you can issue the
CREATE DATABASE command. I think the common approach is to use "-d template1"
in combination with -C.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-10-05 21:58:10 Re: Verifying Referential Integrity
Previous Message Vivek Khera 2004-10-05 21:28:44 Re: Random not so random