Re: Serial not so unique?

From: Stephen Robert Norris <srn(at)commsecure(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Serial not so unique?
Date: 2001-08-18 20:26:15
Message-ID: 20010819062615.C16924@sunhill.commsecure.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Aug 18, 2001 at 10:40:33AM -0400, Tom Lane wrote:
> Stephen Robert Norris <srn(at)commsecure(dot)com(dot)au> writes:
> > On investigation, it seems that the serial number has got to 101, then
> > set itself back to 4, causing nextval to return 5, and there are already
> > entries from 1-101.
>
> Never heard of such misbehavior before. What PG version are you
> running? Any chance of providing a reproducible example?
>
> > Has anyone seen anything like this? I can work around it by generating
> > a serial number within the application, but that's not ideal.
>
> Frankly, I suspect that the problem *is* in your application. Sequences
> are completely reliable in everyone else's experience... they've got
> documented shortcomings like leaving "holes" in their output, but they
> don't generate the same nextval() multiple times.
>
> regards, tom lane

It wouldn't surprise me if it was the application's fault, but what should
I look for? Is setval() the only way to effect the sequence?

Stephen

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Elphick 2001-08-18 22:04:40 COPY and triggers
Previous Message Stephen Robert Norris 2001-08-18 20:25:12 Re: Serial not so unique?