Re: Serial not so unique?

From: Stephen Robert Norris <srn(at)commsecure(dot)com(dot)au>
To: Justin Clift <justin(at)postgresql(dot)org>
Cc: Joe Conway <joseph(dot)conway(at)home(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Serial not so unique?
Date: 2001-08-19 03:18:00
Message-ID: 20010819131800.F16924@sunhill.commsecure.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Aug 19, 2001 at 12:42:36PM +1000, Justin Clift wrote:
> Hi Stephen,
>
> That's weird behaviour. If you'd manually created the sequence like
> this :
>
> CREATE SEQUENCE foo_seq MINVALUE 4 MAXVALUE 101 CYCLE
>
> Then referenced it as the default like this :
>
> CREATE TABLE bar (idnum integer UNIQUE DEFAULT nextval('foo_seq') NOT
> NULL, otherstuff varchar(20));
>
> That would explain the wrapping around behaviour, but not when the field
> is a SERIAL type.
>
> :(
>
> + Justin Clift

Indeed. What's worse is that the first time around it went from 1 -> 101.

Stephen

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Robert Norris 2001-08-19 03:51:38 Re: Serial not so unique?
Previous Message Justin Clift 2001-08-19 02:42:36 Re: Serial not so unique?