In Rails 4.2 with Postgresql I got this error when trying to save a new ActiveRecord object
PG::UniqueViolation: ERROR: Duplicate Key Value Violates Unique Constraint 'My_table_name_pkey'
It looks like it's trying to insert the record into the table with a primary key that already exists. How do I sort this out?