Hacker News new | ask | show | jobs
by janus 1260 days ago
This is great, except for the additional query each time a record is instantiated in the rails concern. That might cause some performance problems in high traffic.

Perhaps it’d be better to attempt the insertion and change the id only if there’s a colission detected with a uniqueness constraint

1 comments

In PostgreSQL, if a DB exception is raised (unique_violation), the whole transaction will abort: there is no way to retry.