Search Postgresql Archives

Re: cloning database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 work:
> 
> for i in {1..150}; do createdb -T database_source database$i; done
> 
> it's not a built-in, but very close.
> 
> depesz

Any advantage to this compared to using pl/pgsql via a DO command while
connected to the postgres database?  Note it would require dynamic SQL
(i.e., EXECUTE).

David J.






--
View this message in context: http://postgresql.1045698.n5.nabble.com/cloning-database-tp5819599p5819805.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux