Re: Dump & Load a database???

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <pgsql-admin(at)postgresql(dot)org>,"smiley2211" <smiley2211(at)yahoo(dot)com>
Subject: Re: Dump & Load a database???
Date: 2007-08-21 14:57:39
Message-ID: 46CAB713.EE98.0025.0@wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

>>> On Tue, Aug 21, 2007 at 9:50 AM, in message <12256258(dot)post(at)talk(dot)nabble(dot)com>,
smiley2211 <smiley2211(at)yahoo(dot)com> wrote:

> Do I have to DROP \ recreate and load the target database (this is what I
> currently do)? is there a way to just do an IN PLACE load like in other
> RDBMS environments???
>
> pg_dump proddb | gzip > proddb_082107.sql.gz
>
> gunzip < proddb_082107.sql.gz | psql -d testdb -f -

You might want to consider using one or both of these pg_dump options:

-c, --clean clean (drop) schema prior to create
-C, --create include commands to create database in dump

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Marlowe 2007-08-21 15:30:24 Re: how to call sql code without function
Previous Message Chris Hoover 2007-08-21 14:54:50 How to export query results