记录中的每组值都应该是唯一的吗?
我有一个数据库,在每条记录上存储一对 x,y 坐标。我已经获得了 1000 积分。但是,如何确保数据库中没有重复的点呢? (我想在该坐标系中填充固定数量的点,并尝试避免使用 postgres 点类型。)
I have a database storing a pair of x,y coordinates on each records. I have already generated 1000 points. However, how can I make sure there's no duplicate points in the database? (I want to populate a fixed number of points in that coordinate system and am trying avoid using postgres point type.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在两列上添加唯一约束:
Add unique constraint on both columns: