Re: How to merge 3 databases in one database quickly - Mailing list pgsql-general

From Shridhar Daithankar
Subject Re: How to merge 3 databases in one database quickly
Date
Msg-id 3EE1F2FB.10920.59350E2@localhost
Whole thread Raw
In response to How to merge 3 databases in one database quickly  (Nagib Abi Fadel <nagib_postgres@yahoo.com>)
List 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.


pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Return Record
Next
From: Jeff Fitzmyers
Date:
Subject: Re: Backups and restores.