Re: How to make a copy of schema

Поиск
Список
Период
Сортировка
Искать
От
A. Kretschmer
Тема
Re: How to make a copy of schema
Дата
Msg-id
20061015163527.GA15757@a-kretschmer.de
Ответ на
Список
Дерево обсуждения
Re: How to make a copy of schema "Andrus" <eetasoft@online.ee>
am  Sun, dem 15.10.2006, um 19:10:53 +0300 mailte Andrus folgendes:
> I have a five company Postgres 8.1 database.
> 
> Each company data is stored in a different schema named Company1, Company2, 
> ..., Company5
> There is also public schema which contains common data.
> 
> Now customer wants to add sixth company to database.
> 
> In need to add some routine to my application which can create schema copy ?

You can make a pg_dump with option -n Company5, replace in the dump
Company5 with Company6 and restore this.

Or, make the dump, rename schema Company5 to Company6 and restore then
the dump.

Be careful with things like sequences!


Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47215,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net
В списке pgsql-general по дате отправления
От: Merlin Moncure
Дата:
Сообщение: Re: more anti-postgresql FUD
От: Tom Lane
Дата:
Сообщение: Re: Triggers
FAQ