Re: How to make a copy of schema

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to make a copy of schema
Date: 2006-10-15 16:35:27
Message-ID: 20061015163527.GA15757@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-10-15 16:43:30 Re: Triggers
Previous Message Merlin Moncure 2006-10-15 16:30:45 Re: more anti-postgresql FUD