postgresql duplicate key violates unique constraint

前端 未结 8 979
隐瞒了意图╮
隐瞒了意图╮ 2020-12-02 10:37

Hi i have a question i know this was posted many times but i didn\'t find an answer to my problem. The problem is that i have a table and a column \"id\" i want it to be uni

8条回答
  •  日久生厌
    2020-12-02 11:08

    Referrence - https://www.calazan.com/how-to-reset-the-primary-key-sequence-in-postgresql-with-django/

    I had the same problem try this: python manage.py sqlsequencereset table_name

    Eg:

    python manage.py sqlsequencereset auth
    

    you need to run this in production settings(if you have) and you need Postgres installed to run this on the server

提交回复
热议问题