Re: Postrgres Sequence Error

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: carter ck <carterck32(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Postrgres Sequence Error
Date: 2006-10-23 02:16:14
Message-ID: 20061023021614.GA32145@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Oct 23, 2006 at 08:27:46AM +0800, carter ck wrote:
> Currently I am ancountering a sequnce error. THe sequence number is being
> used up to 573, but, suddenly and unexpectedly, when I issue the select
> nextval command, it gives the value of 400, which is currently occupied by
> a record.

What do you mean by "the sequence number is being used up to 573"?
Are you saying that nextval() returns 573 and then returns 400? Or
do you mean that a table's serial column has values up to 573? In
the latter case somebody might have inserted values not obtained
from the sequence and now the sequence is colliding with those
values.

Is it possible that something is resetting the sequence? Have you
enabled statement logging to investigate?

--
Michael Fuhr

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2006-10-23 03:07:07 Re: c (lowercase) privilege
Previous Message carter ck 2006-10-23 00:27:46 Postrgres Sequence Error