Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Using natural keys is what actually can prevent duplicate rows. In your above example, if email is the PK, there would be no duplicates. But adding an id as a PK would essentially keep your database with duplicates:

(1, 'bob', 'bob@bobco.com')

(2, 'bob', 'bob@bobco.com')



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: