Re: How to merge 3 databases in one database quickly

From: "Shridhar Daithankar" <shridhar_daithankar(at)persistent(dot)co(dot)in>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to merge 3 databases in one database quickly
Date: 2003-06-07 08:43:15
Message-ID: 3EE1F2FB.10920.59350E2@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 4 Jun 2003 at 0:52, Nagib Abi Fadel wrote:

>
> I'm trying to merge 3 databases in one database using pg_dump.
>
> pg_dump db1 > database.txt
> pg_dump db2 >> database.txt
> pg_dump db3 >> database.txt
>
> then i restore:
> psql database < database.txt

I haven't looked at database dump recently, but I believe the problem might be
that you have conflicting object names in 3 databases. e.g. if there are two
table of same name customer but different schema, things will obviously abort.

Assuming you have 7.3.x, you can edit each database dump and put a create
schema statement on top of each dump file and set that schema first in schema
search path. That way your 3 databases will end up in 3 schemas.

If you could tell us the exact errors you are getting that would be more
helpful.

HTH

Bye
Shridhar

--
Wilcox's Law: A pat on the back is only a few centimeters from a kick in the
pants.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2003-06-07 08:46:05 Re: Return Record
Previous Message Jeff Fitzmyers 2003-06-07 04:56:38 Re: Backups and restores.