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 04:44:23PM +0800, Yan Chunlu wrote:
> I would like to implement two master db with even-odd id sharding.   in
> mysql it is fairly easy by using the configuration:
> 
> auto_increment_offset = 1
> auto_increment_increment = 2
> 
> 
> but I have searched a lot didn't find anything related to this, some users
> doing this via trigger like "rubyrep".
> 
> is there an easy way to do this?  thanks!

Why not adjust the underlying sequences to have different start values
and to advance by 2?

A

-- 
Andrew Sullivan
ajs@xxxxxxxxxxxxxxx

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