pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Soulabaille Samantha <samantha.soulabaille@sihpic.fr>
To: Ben K. <bkim@coe.tamu.edu>
To: pgsql-admin@postgresql.org
Subject: Re: two databases in one
Date: Wed, 16 Aug 2006 16:44:54 +0200
Message-ID: <44E32F66.2060600@sihpic.fr> (raw)
In-Reply-To: <Pine.GSO.4.64.0608160739500.7308@coe.tamu.edu>
References: <44E2C5A9.4070505@sihpic.fr>
	<Pine.GSO.4.64.0608160739500.7308@coe.tamu.edu>

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
>
>

Attachments:

samantha.soulabaille.vcf (text/x-vcard, 211B) download 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

view thread (6+ messages)  latest in thread

Message-ID: <44E32F66.2060600@sihpic.fr>
Permalink:  ../44E32F66.2060600@sihpic.fr/
Also on:    postgresql.org/message-id/44E32F66.2060600@sihpic.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: samantha.soulabaille@sihpic.fr, bkim@coe.tamu.edu
  Subject: Re: two databases in one
  In-Reply-To: <44E32F66.2060600@sihpic.fr>
  References: <44E2C5A9.4070505@sihpic.fr> <Pine.GSO.4.64.0608160739500.7308@coe.tamu.edu> <44E32F66.2060600@sihpic.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox