Re: cloning database

From: Philipp Kraus <philipp(dot)kraus(at)flashpixx(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: cloning database
Date: 2014-09-20 15:50:52
Message-ID: lvk7os$quv$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2014-09-19 11:04:36 +0000, hubert depesz lubaczewski said:

> On Fri, Sep 19, 2014 at 8:35 AM, Philipp Kraus
> <philipp(dot)kraus(at)flashpixx(dot)de> wrote:
> Is there a buildin way to clone the "database_source" with all
> structure and data into a new database "database1..150" ?
>
> assuming you're using bash shell, this should work:
>
> for i in {1..150}; do createdb -T database_source database$i; done
>
> it's not a built-in, but very close.
>
> depesz

Thanks this is nice, to define a template and run the shell script

Thanks a lot

Phil

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-09-20 17:56:52 Re: can't restore database created with pg_dump
Previous Message Eric Smith 2014-09-20 15:43:14 Re: can't restore database created with pg_dump