Skip site navigation (1) Skip section navigation (2)

Re: portable DBAPI auto-increment

From: David Blewett <david(at)dawninglight(dot)net>
To: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
Cc: Mark Sienkiewicz <sienkiew(at)stsci(dot)edu>, psycopg(at)postgresql(dot)org
Subject: Re: portable DBAPI auto-increment
Date: 2011-04-08 17:04:46
Message-ID: BANLkTinvuN-q1UeCYTwMyVKdgE1ByGtM8g@mail.gmail.com (view raw or flat)
Thread:
Lists: psycopg
On Fri, Apr 8, 2011 at 12:42 PM, Daniele Varrazzo
<daniele(dot)varrazzo(at)gmail(dot)com> wrote:
> On Fri, Apr 8, 2011 at 5:23 PM, Mark Sienkiewicz <sienkiew(at)stsci(dot)edu> wrote:
>> (For comparison, mysql uses an unsigned 64 bit value for auto increment and
>> chokes when it runs out.  sqlite wraps, but it automatically finds a new key
>> value that is not used.)
>
> Please, read the fine manual: PostgreSQL has a 64 bit bigserial data type too.

In addition, if you absolutely have to have the full 64 bit range, you
can set the starting value of the sequence to -9223372036854775808.

-- 
Thanks,

David Blewett

In response to

psycopg by date

Next:From: Marko KreenDate: 2011-04-08 17:36:25
Subject: Re: portable DBAPI auto-increment
Previous:From: Daniele VarrazzoDate: 2011-04-08 16:42:57
Subject: Re: portable DBAPI auto-increment

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group