serial + db key, or guid? - Mailing list pgsql-general

From Mark Phillips
Subject serial + db key, or guid?
Date
Msg-id 7D67E902-4581-4380-903E-92ECAA9B3866@mophilly.com
Whole thread Raw
Responses Re: serial + db key, or guid?  (Christophe Pettus <xof@thebuild.com>)
List pgsql-general
Given four instances of posgres, each with a database, each instance receiving new data, and desiring a data “merge” a
laBDR or similar multiple database solutions, my team has been discussing the pros and cons of generating unique keys
ineach table. 

1. create a unique “database” id for each database, add a column to all tables for this id value and combine that with
aserial id 
2. use guid from pg functions
3. create id ranges for each database, e.g. db1 gets 1 to 1M, db2 gets 1M+1 to 2M, and so on

All get us to the finish line, but each has its drawbacks.

Advice, cautionary tales, suggestions and such will be warmly received.

 - Mark


pgsql-general by date:

Previous
From: John W Higgins
Date:
Subject: Re: UUID or auto-increment
Next
From: Christophe Pettus
Date:
Subject: Re: serial + db key, or guid?