[Chicago] auto incrementing - what options do we have?

Martin Maney maney at two14.net
Sat Oct 11 02:40:37 CEST 2008


On Fri, Oct 10, 2008 at 03:17:34PM -0500, Lukasz Szybalski wrote:
> Thanks for the info. It seems as postgresql has the isolation
> implemented which means I will be going with postgre then.

Actually, if you're going to use postgres, you can instantiate the same
kind of incrementing counters that provide autoincrement values to
"serial number" columns, and access them to get unique, sequential
serial numbers.  Well, unique as long as the source that starts with
3000 never sends you more than 999 items, at which time it would clash
with the first one from the source that begins at 4000...

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

Refer to the docs for more details, of course.

-- 
Although we may never know with complete certainty the identity
of the winner of this year's presidential election, the identity
of the loser is perfectly clear.  It is the nation's confidence
in the judge as an impartial guardian of the law.
 - Justice John Paul Stevens, from his dissenting opinion Dec 12, 2000



More information about the Chicago mailing list