Re: combining db's- importing primary keys

Поиск
Список
Период
Сортировка
От Bob Gobeille
Тема Re: combining db's- importing primary keys
Дата
Msg-id DC7E876B-454F-4EC3-AB62-240475B00B74@hp.com
обсуждение исходный текст
Ответ на Re: combining db's- importing primary keys  (Jasen Betts <jasen@xnet.co.nz>)
Список pgsql-general
On Jul 29, 2009, at 7:02 AM, Jasen Betts wrote:

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

I can't believe this didn't occur to me.  All my primary keys are
bigint's, but I could add a second field, a unique server number or
name, and change my primary (and foreign) keys to the two column
combination.  This would make it easy for new db's but I need to give
some thought to see if there will be any hiccups migrating all the db's.

Many thanks Jasen.

Bob

В списке pgsql-general по дате отправления:

Предыдущее
От: Emanuel Calvo Franco
Дата:
Сообщение: Problems compiling contribs in Open Solaris
Следующее
От: nha
Дата:
Сообщение: Re: combining db's- importing primary keys