Re: Problems with sequences

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Arturo Perez <aperez(at)hayesinc(dot)com>
Cc: Alban Hertroys <alban(at)magproductions(dot)nl>, pgsql-general(at)postgresql(dot)org
Subject: Re: Problems with sequences
Date: 2006-09-07 12:49:26
Message-ID: 20060907124926.GN10093@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2006-09-07 12:52:01 Re: Problems with sequences
Previous Message Ray Stell 2006-09-07 12:32:46 Re: archives is not working was (Re: [NOVICE] Removing duplicate keys)