Re: how to adjust auto increment id offset? - Mailing list pgsql-general

From Scott Marlowe
Subject Re: how to adjust auto increment id offset?
Date
Msg-id CAOR=d=3UDWr=nn0F5ABJC74NUd8Bj7wJdJcAXf_VOMszXg6txg@mail.gmail.com
Whole thread Raw
In response to Re: how to adjust auto increment id offset?  (Yan Chunlu <springrider@gmail.com>)
List pgsql-general
On Tue, Nov 15, 2011 at 9:03 PM, Yan Chunlu <springrider@gmail.com> wrote:
> thanks a lot for the tip!
> sorry for used the wrong word, it is just multi-master but not sharding,  I
> would like to setup two master server across two datacenter.  one's id
> increased by 1, and the other by 2.
> so I could have a queue sync the record in the background by myself.  kind
> of a dumb way but it seems they only choice for me,  the delay within
> several minutes is acceptable.

you might want to look at either using a larger skip, like 10 or 20,
so you can add more servers at a later date if you need to.  The other
way is to start each sequence at some huge offset like 2Billion and be
sure to use a bigint not a regular int.

pgsql-general by date:

Previous
From: Yan Chunlu
Date:
Subject: Re: how to adjust auto increment id offset?
Next
From: Gavin Flower
Date:
Subject: Re: partitioning a dataset + employing hysteresis condition