Re: [Q] Cluster design for geographically separated dbs
От | Scott Marlowe |
---|---|
Тема | Re: [Q] Cluster design for geographically separated dbs |
Дата | |
Msg-id | dcc563d10903081427h21c20d69se6889d44eb3311ef@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [Q] Cluster design for geographically separated dbs ("V S P" <toreason@fastmail.fm>) |
Список | pgsql-general |
On Sun, Mar 8, 2009 at 1:01 PM, V S P <toreason@fastmail.fm> wrote: > Thank you, > Is there a way, in the same idea, > to make postgresql 'skip' say every 100 numbers when generating > a 'next' in bigserial? > (or to insure that every number generated is evenly divisible by 100, > and then another db would be 99 and so on) > > In oracle, if I remember right, there was something called a 'Step' > for the sequence values. To find this stuff in pgsql you can either wander through the manual, or fire up psql and ask it: smarlowe=# \h create sequence Command: CREATE SEQUENCE Description: define a new sequence generator Syntax: CREATE [ TEMPORARY | TEMP ] SEQUENCE name [ INCREMENT [ BY ] increment ] [ MINVALUE minvalue | NO MINVALUE ] [ MAXVALUE maxvalue | NO MAXVALUE ] [ START [ WITH ] start ] [ CACHE cache ] [ [ NO ] CYCLE ] [ OWNED BY { table.column | NONE } ] smarlowe=# \h alter sequence Command: ALTER SEQUENCE Description: change the definition of a sequence generator Syntax: ALTER SEQUENCE name [ INCREMENT [ BY ] increment ] [ MINVALUE minvalue | NO MINVALUE ] [ MAXVALUE maxvalue | NO MAXVALUE ] [ RESTART [ WITH ] start ] [ CACHE cache ] [ [ NO ] CYCLE ] [ OWNED BY { table.column | NONE } ] ALTER SEQUENCE name RENAME TO new_name ALTER SEQUENCE name SET SCHEMA new_schema As you can see there's an increment setting that sets what you're wanting to set.
В списке pgsql-general по дате отправления: