On Mon, May 6, 2019 at 6:05 AM Arup Rakshit <a...@zeit.io> wrote:

SELECT MAX(id) FROM chinese_price_infos;  max   --------  128520(1 row)
SELECT nextval('chinese_price_infos_id_seq');  nextval ---------   71164(1
row)
Not sure how it is out of sync. How can I fix this permanently. I ran
vacuum analyze verbose; still same error

Vacuuming the table doesn't change the fact that your sequence isn't
generating unique keys.  Without knowing the full history of the table, I
can only speculate as to how keys got inserted that are beyond the
sequence's current vlue, but most likely you will need to use the sequence
manipulation function setval to set the sequence to at least one greater
than the current maximum value.
--
Mike Nolan

Reply via email to