Re: combining db's- importing primary keys - Mailing list pgsql-general

From nha
Subject Re: combining db's- importing primary keys
Date
Msg-id 4A7072F9.6000506@free.fr
Whole thread Raw
In response to Re: combining db's- importing primary keys  (Bob Gobeille <bob.gobeille@hp.com>)
List pgsql-general
Hello,

Le 29/07/09 16:44, Bob Gobeille a écrit :
>
> On Jul 29, 2009, at 8:26 AM, nha wrote:
>
>> Hello,
>>
>> Le 29/07/09 15:02, Jasen Betts a écrit :
>>> On 2009-07-27, Bob Gobeille <bob.gobeille@hp.com> wrote:
>>>> I would like to combine multiple databases (same schema) into one
>>>> master db.   Does anyone know how I can reconcile all my primary and
>>>> foreign keys to maintain referential integrity.
>>>
>>> prefix them all with something that's unique to their source database.
>>>
>>> easy to say, hard to do.
>>>
>>
>> A process (and solution) may be different whether: [...cases...]
>
> In my immediate case, I'm simply combining 7 global databases into a
> single master.
>
> Eventually, I would like to allow our (fossology.org) users to subscribe
> to data in other databases.  That is, allow
> users to do periodic one-way batch updates from other servers.
>
> Bob

In such a purpose (where asynchronous updates seem reasonable),
prefixing (as suggested by Jasen Bett) or adding server-based column to
current keys (as you mention thereafter) look like handy solutions.

Good plan.

Regards.

--
nha / Lyon / France.

pgsql-general by date:

Previous
From: Greg Stark
Date:
Subject: Re: Clients disconnect but query still runs
Next
From: Jennifer Trey
Date:
Subject: Re: How do I run PG Tuning Wizard on Linux?