
> Throws an exception due to the following sql error: duplicate key> violates unique constraint.Your primary key index isn't in sync or something.Can you login to psql and run the following?SELECT MAX(ID) FROM entitIEs;What is the result?Then run...SELECT nextval('entitIEs_ID_seq');This should be higher than the last result.Is it the same or lower? If so... dID you do some importing orrestoring? (your sequence might be off)If it's not higher... run this to try and fix it. (run a quickpg_dump first...)SELECT setval('entitIEs_ID_seq',(SELECT MAX(ID) FROM entitIEs)+1);reload your app...and see if its still happening.Good luck!总结
以上是内存溢出为你收集整理的postgresql duplicate key violates unique constraint全部内容,希望文章能够帮你解决postgresql duplicate key violates unique constraint所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)