postgresql 和 django - 该行没有唯一标识符
当我进行查询以创建报告时,Django postgresql 数据库上的两个条目给我带来了很多麻烦。当我尝试删除这些条目(通过 phpPgAdmin)时,收到错误“此行没有唯一标识符”。没有重复的 ID。我已经尝试更新所有字段。我尝试使用删除按钮和手动 SQL 命令来删除它们。我没主意了。有人知道如何给一行指定一个唯一标识符,这样我就可以删除它吗?
谢谢!
Two entries on my Django postgresql database are causing me a world of trouble when I go a-querying to create reports. When I try to delete these entries (via phpPgAdmin), I get the error "No unique identifier for this row." There are no duplicate IDs. I've tried updating all the fields. I've tried getting rid of these using the delete button and manual SQL commands. I'm out of ideas. Anyone know hot to give a row a unique identifier so I can get rid of it?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通过特殊的 ctid 系统列查找该行,然后按该值删除。 ctid 是独一无二的。
Look up the row by the special ctid system column and then delete by that value. ctid's are unique.
您要删除的行可能会在另一个表中引用。
删除它们或将它们引用到其他内容,然后尝试删除给定的行。
The rows you are going to delete may be referenced in another table.
remove them or refer them to something else and, then try to remove your given rows.