Search Postgresql Archives

Re: how to adjust auto increment id offset?

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

 



On Tue, Nov 15, 2011 at 9:03 PM, Yan Chunlu <springrider@xxxxxxxxx> 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.

-- 
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