Re: Postgresql replication

From: Greg Stark <gsstark(at)mit(dot)edu>
To: William Yu <wyu(at)talisys(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Postgresql replication
Date: 2005-08-25 00:39:50
Message-ID: 877jeaetnt.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


William Yu <wyu(at)talisys(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Aly Dharshi 2005-08-25 00:46:34 Re: Postgresql replication
Previous Message Tom Lane 2005-08-24 23:32:55 Re: Problem finding libpg.3.dylib on macos X in plperlu procedure