Re: [Q] Cluster design for geographically separated dbs - Mailing list pgsql-general

From Scott Marlowe
Subject Re: [Q] Cluster design for geographically separated dbs
Date
Msg-id dcc563d10903081427h21c20d69se6889d44eb3311ef@mail.gmail.com
Whole thread Raw
In response to Re: [Q] Cluster design for geographically separated dbs  ("V S P" <toreason@fastmail.fm>)
List 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 by date:

Previous
From: "V S P"
Date:
Subject: Re: [Q] Cluster design for geographically separated dbs
Next
From: Scott Marlowe
Date:
Subject: Re: Random Deadlock on DROP CONSTRAINT