Copy content from dbs

Поиск
Список
Период
Сортировка
Искать

Copy content from dbs

От:
Guido Neitzer <guido.neitzer@pharmaline.de>
Дата:
Hi.

Is there an easy way to copy the content including the table  
structure, indexes and so on from one db to another?

Let's say I have a production db called db_production and want to  
create a development db called db_dev with exactly the same content  
on the same machine - just with the different name?

cug

Re: Copy content from dbs

От:
Thomas Kellerer <spam_eater@gmx.net>
Дата:
On 14.06.2006 13:56 Guido Neitzer wrote:
> Hi.
> 
> Is there an easy way to copy the content including the table structure, 
> indexes and so on from one db to another?
> 
> Let's say I have a production db called db_production and want to create 
> a development db called db_dev with exactly the same content on the same 
> machine - just with the different name?

pg_dump: http://www.postgresql.org/docs/8.1/static/app-pgdump.html

Thomas

Re: Copy content from dbs

От:
Guido Neitzer <guido.neitzer@pharmaline.de>
Дата:
On 14.06.2006, at 14:02 Uhr, Thomas Kellerer wrote:

> pg_dump: http://www.postgresql.org/docs/8.1/static/app-pgdump.html

Found it. Thanks. I was just blind and thought, pg_dump can only re- 
create the db with the same name.

Thanks,
Guido

Re: Copy content from dbs

От:
"A. Kretschmer" <andreas.kretschmer@schollglas.com>
Дата:
am  14.06.2006, um 13:56:06 +0200 mailte Guido Neitzer folgendes:
> Hi.
> 
> Is there an easy way to copy the content including the table  structure, 
> indexes and so on from one db to another?

Create the new db with the old db as template.


Andreas
-- 
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47215,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
 ===    Schollglas Unternehmensgruppe    === 

Re: Copy content from dbs

От:
Guido Neitzer <guido.neitzer@pharmaline.de>
Дата:
On 14.06.2006, at 14:12 Uhr, A. Kretschmer wrote:

>> Is there an easy way to copy the content including the table   
>> structure,
>> indexes and so on from one db to another?
>
> Create the new db with the old db as template.

Thanks, but as far as I can see, I have to disconnect all clients  
from the production db to do this and this wasn't an option.

I forgot to mention that. The pg_dump way is fine for me.

cug
FAQ