Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
ahachete
42 days ago
|
parent
|
context
|
favorite
| on:
PgFirstAid: PostgreSQL function for improving stab...
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:
(1, 'bob', 'bob@bobco.com')
(2, 'bob', 'bob@bobco.com')