Re: how to adjust auto increment id offset?

Поиск
Список
Период
Сортировка
От Andrew Sullivan
Тема Re: how to adjust auto increment id offset?
Дата
Msg-id 20111115103007.GC22964@shinkuro.com
обсуждение исходный текст
Ответ на how to adjust auto increment id offset?  (Yan Chunlu <springrider@gmail.com>)
Список 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@crankycanuck.ca

В списке pgsql-general по дате отправления:

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: how to adjust auto increment id offset?
Следующее
От: Venkat Balaji
Дата:
Сообщение: : Postgres installation error on CentOS