Re: how to adjust auto increment id offset?

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: how to adjust auto increment id offset?
Date: 2011-11-15 10:30:07
Message-ID: 20111115103007.GC22964@shinkuro.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)crankycanuck(dot)ca

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Venkat Balaji 2011-11-15 11:58:07 : Postgres installation error on CentOS
Previous Message John R Pierce 2011-11-15 09:12:11 Re: how to adjust auto increment id offset?