Re: cloning database

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Philipp Kraus *EXTERN*" <philipp(dot)kraus(at)flashpixx(dot)de>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: cloning database
Date: 2014-09-19 07:19:48
Message-ID: A737B7A37273E048B164557ADEF4A58B17D41611@ntex2010a.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Philipp Kraus wrote:
> I need around 150 copies of a database (for an exam). I have got a
> database with tables and data and for my exam I would copy this
> database in his way:
>
> database_source
>
> database1
> database2
> ….
> database150
>
> Is there a buildin way to clone the "database_source" with all
> structure and data into a new database "database1..150" ?

CREATE DATABASE database1 TEMPLATE database_source;

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marius Grama 2014-09-19 07:32:09 ALTER TEXT field to VARCHAR(1024)
Previous Message Szymon Guz 2014-09-19 07:18:29 Re: Why isn't Java support part of Postgresql core?