Re: Restiring pg_dump text file

From: Scott Mead <scott(dot)mead(at)enterprisedb(dot)com>
To: donghe(at)caltech(dot)edu
Cc: Mike angelo <angelocmp(at)yahoo(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Restiring pg_dump text file
Date: 2009-07-01 03:35:13
Message-ID: d3ab2ec80906302035q66490950yd2b48459d3a550ae@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Tue, Jun 30, 2009 at 11:26 PM, <donghe(at)caltech(dot)edu> wrote:

> > I've backed up my DB via 'pg_dump dbname' using no options. In order to
> > restore it via psql, do I first need to drop the db instance and recreate
> > it?
> >
> > Thanks in advance for your help.
> >
> > -Mike
> >
> >
> >
> yes, you have to drop the original db, then use psql -f to restore it.

You don't have to drop it, you can create another db by any other name and
re-run the sql file there. The only time you have to worry is if you use
the -C (--create) option to pg_dump. This would actually issue a 'create
database' command in the sql dump. But for you, you can restore to another
database if you would like.

--Scott

>
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Mead 2009-07-01 03:36:38 Re: Restiring pg_dump text file
Previous Message donghe 2009-07-01 03:26:48 Re: Restiring pg_dump text file