X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 2622B9FB343 for ; Wed, 16 Aug 2006 10:50:18 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 41216-06 for ; Wed, 16 Aug 2006 10:50:05 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from coe.tamu.edu (edsun.coe.tamu.edu [165.91.232.6]) by postgresql.org (Postfix) with ESMTP id B07429FB30E for ; Wed, 16 Aug 2006 10:50:05 -0300 (ADT) Received: (from root@localhost) by bruner.coe.tamu.edu (8.13.1/8.13.1) id k7GDmtNs024213; Wed, 16 Aug 2006 08:48:55 -0500 Received: from coe.tamu.edu (coe.tamu.edu [165.91.232.6]) by coe.tamu.edu (8.11.7p2+Sun/8.12.11) with ESMTP id k7GDmGA09533; Wed, 16 Aug 2006 08:48:16 -0500 (CDT) Date: Wed, 16 Aug 2006 08:48:14 -0500 (CDT) From: "Ben K." To: Soulabaille Samantha cc: pgsql-admin@postgresql.org Subject: Re: two databases in one In-Reply-To: <44E2C5A9.4070505@sihpic.fr> Message-ID: References: <44E2C5A9.4070505@sihpic.fr> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by AMaViS 0.3.12 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200608/184 X-Sequence-Number: 22727 > I've got two databases with the same tables and schema on two different > servers. > I want to have only one database. > So i would like to insert in the first database the data of the second > database. > I don't know how to do this because almost of the tables contains serial. > It's for production databases, i can't make mistakes. Maybe you could just import the second database into another schema of the first database if it's urgent... Otherwise the nature of conflicts will have to be thought through, like - Are there some data that exist in both databases - i.e. which become duplicates if both tables are merged? - Are the serials used as foreign keys in other tables or as the basis of any other fields? - Can the serials be changed to different numbers - e.g., is it ok or even needed to convert "11" on database B to "10011" on database A and so on, to avoid conflict two ID 11 records having different data? - Does the order of records matter? Once the problem is familiar, many gurus will be able to help. I just wanted to provide a starter. Regards, Ben K. Developer http://benix.tamu.edu