Re: Copying a database.

From: Steve Atkins <steve(at)blighty(dot)com>
To: PostgreSQL pg-general List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Copying a database.
Date: 2014-07-20 18:28:27
Message-ID: 2795BCD4-6BEE-4B19-A08D-8ABE753688EA@blighty.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Jul 20, 2014, at 11:09 AM, maillists0(at)gmail(dot)com wrote:

> I send a nightly dump of my production database to a development server. A script drops the existing development database and 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 named db 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-07-20 18:54:16 Re: Copying a database.
Previous Message maillists0 2014-07-20 18:09:42 Copying a database.