Re: Problems with sequences - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Problems with sequences
Date
Msg-id 20060907124926.GN10093@svana.org
Whole thread Raw
In response to Re: Problems with sequences  (Arturo Perez <aperez@hayesinc.com>)
Responses Re: Problems with sequences  (Alban Hertroys <alban@magproductions.nl>)
List pgsql-general
On Thu, Sep 07, 2006 at 07:15:43AM -0400, Arturo Perez wrote:
> Note that all of the above was in an attempt to reset the sequence to
> the proper value.  I'm beginning to think that it's a library problem
> as this morning I get:
>
> iht=> select max(article_id) from article;
> max
> ------
> 4992
> (1 row)
>
> iht=> select nextval('pk_article');
> nextval
> ---------
>     4986
> (1 row)
>
> Assuming the sequence number is being used correctly why would they
> be 6 apart?

The last four transactions could be rolled back, or not committed yet.

I'd suggest looking at your insert statements. If the actual inserts
are insterting actual numbers, look very very carefully where the numbers
are coming from.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: Ray Stell
Date:
Subject: Re: archives is not working was (Re: [NOVICE] Removing duplicate keys)
Next
From: "Merlin Moncure"
Date:
Subject: Re: Problems with sequences