英文:
ERROR: duplicate key value violates unique constraint "constraint_name"
问题
我一直在收到以下错误:
错误:重复的关键值违反唯一约束“child_pkey”
详细信息:关键字(child_id)=(4)已存在。
这是我尝试运行的查询:
INSERT INTO child
VALUES(4, 'Max','Roy','M', 2) ;
对于child_id=4,我现在还没有插入任何数据,但我仍然收到此错误。
为了交叉检查,我检查了表,没有现有的child_id = 4的条目。
如果有人能帮忙,我将不胜感激。
英文:
I have been recieving the following error:
ERROR: duplicate key value violates unique constraint "child_pkey"
DETAIL: Key (child_id)=(4) already exists.
This is the query I tried to run:
INSERT INTO child
VALUES(4, 'Max','Roy','M', 2) ;
for child_id=4 i have not inserted any data as for now but I am still recieving this error.
Just to cross check I did check the table, and there was no existing entries for child_id = 4
I will be grateful if anyone could help.
答案1
得分: 2
尝试截断该条目,如果ik一直执行相同操作,启动表查询,删除所有表格然后重新创建。
英文:
Try to truncate that entry, if ik keeps doing the same, launch the table query, drop all the table and create it again.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论