http://qs321.pair.com?node_id=610536


in reply to Of Mysql, DBI and PK best practices

Personally, I tend to do two things differently:

Update: As noted by kyle above, however, if this code is executed by multiple users/processes, you could end up with a race condition, such that your inserts might still fail because some other guy just added that record since the time that you selected all the primary keys.