Re: Problem with pg_restore into new database - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: Problem with pg_restore into new database
Date
Msg-id 49215A3D.9040909@iol.ie
Whole thread Raw
In response to Re: Problem with pg_restore into new database  ("Mr. John" <mr_johnmr@yahoo.com>)
List pgsql-general
On 17/11/2008 11:26, Mr. John wrote:
> I read pg_restore documentation and what I understood is that  using
> pg_restore.exe with -C will create  the database named in backup archive
> or specified with -d

You have to connect to *some* database, as Postgres doesn't have the
concept of just connecting to the server without connecting to a database.

Postgres has a maintenance database called "postgres" which is empty,
and it's normal to use this for initial connections if you haven't
already got a specific database to work with. In psql, there's a \c
command with changes the database to which you're connected, and you'll
see this command used in the output from pg_dump to connect to the
database being dumped.

HTH,

Ray.


------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

pgsql-general by date:

Previous
From: "Mr. John"
Date:
Subject: Re: Problem with pg_restore into new database
Next
From: Howard Cole
Date:
Subject: How to reduce impact of a query.