inserts failed because of primary key conflict, weird sequence issue. what could cause a reset? - Mailing list pgsql-general

From jonathan vanasco
Subject inserts failed because of primary key conflict, weird sequence issue. what could cause a reset?
Date
Msg-id 0C538715-CC56-46B2-8E8B-0A565FBE92D2@2xlp.com
Whole thread Raw
Responses Re: inserts failed because of primary key conflict, weird sequenceissue. what could cause a reset?
List pgsql-general
I can't figure out how this happened

I have table where the primary key is a sequence.  I was getting a lot of errors on insertions, and noticed the current
valuewas around 65k, but the max id in the database was around 160k.  everything works now that i've restarted it, but
Ican't find any record of a restart sequence accidentally being put in. 

the only thing I can think of, is the sequence went up several hundred billion and restarted from 0 when a drive
crashed.but that seems incredibly unlikely given the last known actual max id. 

does anyone have an idea what could cause this?  pg 9.6.6 on ubuntu



pgsql-general by date:

Previous
From: Mark Fletcher
Date:
Subject: Logical replication blocking alter/drop
Next
From: Yogesh Sharma
Date:
Subject: Re: Size of pg_multixact/members increases 11355