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 8CD7F9FA7BA for ; Wed, 16 Aug 2006 11:43:53 -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 43816-10 for ; Wed, 16 Aug 2006 11:43:42 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from scrih10.sipic.com (scrih10.sipic.com [83.206.120.220]) by postgresql.org (Postfix) with ESMTP id CC7399FA65C for ; Wed, 16 Aug 2006 11:43:42 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by scrih10.sipic.com (messagerie) with ESMTP id 49D9538BD1; Wed, 16 Aug 2006 16:43:45 +0200 (CEST) Received: from scrih10.sipic.com ([127.0.0.1]) by localhost (scrih10 [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 09585-10; Wed, 16 Aug 2006 16:43:45 +0200 (CEST) Received: from [126.200.0.8] (w80208.sipic.com [126.200.0.8]) by scrih10.sipic.com (messagerie) with ESMTP id DE0C338923; Wed, 16 Aug 2006 16:43:44 +0200 (CEST) Message-ID: <44E32F66.2060600@sihpic.fr> Date: Wed, 16 Aug 2006 16:44:54 +0200 From: Soulabaille Samantha User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: "Ben K." , pgsql-admin@postgresql.org Subject: Re: two databases in one References: <44E2C5A9.4070505@sihpic.fr> In-Reply-To: Content-Type: multipart/mixed; boundary="------------060806040202060707020206" X-Virus-Scanned: amavisd-new at sihpic.fr 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/186 X-Sequence-Number: 22729 This is a multi-part message in MIME format. --------------060806040202060707020206 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Thanks for your response. Indeed , the serials are used as foreign keys. We made a web site with a database. Then we duplicated the web site and the databse (without data, only schéma) for another server . The 2 databases were filled in the same time. Now someone would like to merge the 2 databases and have only 1 site and 1 database. I was thinking about changing serials of the 2nd database and do a restore on the 1st, as you said. But it's a big database, and i'm not sure of the exactly things to do. Ben K. a écrit : >> 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 > > ---------------------------(end of broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match > > --------------060806040202060707020206 Content-Type: text/x-vcard; charset=utf-8; name="samantha.soulabaille.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="samantha.soulabaille.vcf" begin:vcard fn:Samantha Soulabaille n:Soulabaille;Samantha org:SIHPIC adr;dom:;;43 avenue d'Italie;amiens;;80094 cedex 3 email;internet:samantha.soulabaille@sihpic.fr x-mozilla-html:FALSE version:2.1 end:vcard --------------060806040202060707020206--