auto-increment field resetting itself - Mailing list pgsql-general

From Chris Calef
Subject auto-increment field resetting itself
Date
Msg-id 3990707B.70A43162@orcasinc.com
Whole thread Raw
List pgsql-general
Hi.  I tried to post this before but I never saw it come up, I apologize
if it's a repost.  Anyway, I'm having some weird behavior with a
postgres (6.5) autoincrement fields.  I have a field "users_id_seq" that
is hooked to a sequence, when I add users I call nextval('users_id_seq')
as you would expect, but every now and then (it's happened two or three
times in the last few months, to give you and idea of frequency.  Not
every day, just often enough to forget about it) the sequence somehow
gets stuck on a lower number than it should be on, and suddenly no new
users can be added becasue it's trying to duplicate ids.  I have not
manually called "setval" or anything, but I can't guarantee that it
didn't happen as some kind of side effect of work I was doing on it..
I always discover it days later so I don't know precisely what I was
doing at the time that it happened.   At least the last time it
happened, I know I had not been altering the users table, though I had
been adding fields to other tables.
Does that ring any bells at all, with anyone?  If I don't come up with
some kind of answer there's going to be some people getting pretty
pissed at me here, so any advice would be welcome!!
TIA

Chris Calef



pgsql-general by date:

Previous
From: teg@redhat.com (Trond Eivind Glomsrød)
Date:
Subject: Re: AM/PM times? Am I going crazy?
Next
From: Karel Zak
Date:
Subject: Re: AM/PM times? Am I going crazy?