Re: Postgresql replication - Mailing list pgsql-general

From Greg Stark
Subject Re: Postgresql replication
Date
Msg-id 877jeaetnt.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Postgresql replication  (William Yu <wyu@talisys.com>)
List pgsql-general
William Yu <wyu@talisys.com> writes:

> Allocation of unique IDs that don't collide across servers is a must. For 1
> project, instead of using numeric IDs, we using CHAR and pre-append a unique
> server code so record #1 on server A is A0000000001 versus ?x0000000001 on other
> servers. For the other project, we were too far along in development to change
> all our numerics into chars so we wrote custom sequence logic to divide our
> 10billion ID space into 1-Xbillion for server 1, X-Ybillion for server 2, etc.

I would have thought setting the sequences to "INCREMENT BY 100" would let you
handle this simply by setting the sequences on each server to start at a
different value modulo 100.

I wonder if it might be handy to be able to set default sequence parameters on
a per-database level so that you could set this up and then just do a normal
pg_restore of the same schema and get proper non-conflicting sequences on each
server.

I suppose it's the least of your problems though.


--
greg

pgsql-general by date:

Previous
From: Aly Dharshi
Date:
Subject: Re: Postgresql replication
Next
From: Bill Moseley
Date:
Subject: Help with a subselect inside a view