Re: [GENERAL] cloning database

2014-09-20 Thread David G Johnston
hubert depesz lubaczewski wrote > On Fri, Sep 19, 2014 at 8:35 AM, Philipp Kraus < > philipp.kraus@ > > > 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

Re: [GENERAL] cloning database

2014-09-20 Thread Philipp Kraus
On 2014-09-19 11:04:36 +, hubert depesz lubaczewski said: On Fri, Sep 19, 2014 at 8:35 AM, Philipp Kraus 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: fo

Re: [GENERAL] cloning database

2014-09-19 Thread Craig Ringer
On 09/19/2014 07:04 PM, hubert depesz lubaczewski wrote: > > > for i in {1..150}; do createdb -T database_source database$i; done Unless `datistemplate` is set for the database, you'll need to do this as a superuser. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL De

Re: [GENERAL] cloning database

2014-09-19 Thread hubert depesz lubaczewski
On Fri, Sep 19, 2014 at 8:35 AM, Philipp Kraus 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;

Re: [GENERAL] cloning database

2014-09-19 Thread Albe Laurenz
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_so

Re: [GENERAL] cloning database

2014-09-19 Thread Alban Hertroys
On 19 Sep 2014, at 8:35, Philipp Kraus wrote: > Hello, > > 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

[GENERAL] cloning database

2014-09-18 Thread Philipp Kraus
Hello, 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 dat

Re: [GENERAL] Cloning database without dump/restore

2010-11-05 Thread Dimitri Fontaine
"Andrus" writes: > How to clone database fast ? > How to create server side pl/pgsql script which use code like in > pg_dump/pg_restore and or in pg_migrator and clones existing database or > other idea ? See pg_basebackup here: https://github.com/dimitri/pg_basebackup I'm wouldn't expect it

Re: [GENERAL] Cloning database without dump/restore

2010-11-05 Thread John R Pierce
On 11/05/10 1:06 AM, Andrus wrote: Only port 5432 is opened in server. Database can cloned using pg_dup / pg_restore If server is located in internet this requires huge amount of time and bandwidth. you can't log onto the server, no ssh? thats a harsh constraint. moving the data to anot

Re: [GENERAL] Cloning database without dump/restore

2010-11-05 Thread Andreas Schmitz
snapshot might be the keyword you're looking for. regards andreas On 11/05/2010 09:06 AM, Andrus wrote: Only port 5432 is opened in server. Database can cloned using pg_dup / pg_restore If server is located in internet this requires huge amount of time and bandwidth. How to clone database

Re: [GENERAL] Cloning database without dump/restore

2010-11-05 Thread Grzegorz Jaśkiewicz
read documentation on backups. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Cloning database without dump/restore

2010-11-05 Thread Andrus
Only port 5432 is opened in server. Database can cloned using pg_dup / pg_restore If server is located in internet this requires huge amount of time and bandwidth. How to clone database fast ? How to create server side pl/pgsql script which use code like in pg_dump/pg_restore and or in pg_migr