Answer the question
In order to leave comments, you need to log in
How to update sequence of id in postgresql?
I did an import into a Postgresql table including the id, now when inserting a new row the error occurs
duplicate key value violates unique constraint "nutrition_productcategory_pkey"
DETAIL: Key (id)=(1) already exists.
How to set the id to come from the last imported element?
Answer the question
In order to leave comments, you need to log in
ALTER SEQUENCE nutrition_productcategory_seq RESTART WITH <последний id>;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question