IntegrityError duplicate key value violates unique constraint - django/postgres

后端 未结 11 1067
清歌不尽
清歌不尽 2020-11-28 18:44

I\'m following up in regards to a question that I asked earlier in which I sought to seek a conversion from a goofy/poorly written mysql query to postgresql. I believe I suc

11条回答
  •  广开言路
    2020-11-28 19:17

    You just have to go to pgAdmin III and there execute your script with the name of the table:

    SELECT setval('tablename_id_seq', (SELECT MAX(id) FROM tablename)+1);
    

提交回复
热议问题