Re: Copying a database. - Mailing list pgsql-general

From Steve Atkins
Subject Re: Copying a database.
Date
Msg-id 2795BCD4-6BEE-4B19-A08D-8ABE753688EA@blighty.com
Whole thread Raw
In response to Copying a database.  (maillists0@gmail.com)
Responses Re: Copying a database.  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
On Jul 20, 2014, at 11:09 AM, maillists0@gmail.com wrote:

> I send a nightly dump of my production database to a development server. A script drops the existing development
databaseand replaces it with the current production copy.  
>
> Each dev uses her own copy of the database. Is there a way to copy the current development database to a differently
nameddb on the same machine, including the data,  without using the sql dump?  

Look at CREATE DATABASE developer_db WITH TEMPLATE production_copy;

createdb with the --template option is a convenient way to do that from the commandline.

Cheers,
  Steve



pgsql-general by date:

Previous
From: maillists0@gmail.com
Date:
Subject: Copying a database.
Next
From: Adrian Klaver
Date:
Subject: Re: Copying a database.