Search Postgresql Archives

Re: combining db's- importing primary keys

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Jul 29, 2009, at 7:02 AM, Jasen Betts wrote:

On 2009-07-27, Bob Gobeille <bob.gobeille@xxxxxx> 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

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux