in reply to Cycle through primary key with DBI

I'll mention this since you say you're not DB oriented. Some databases -- I admit that I'm Postgre ignorant, so it may not be an issue -- treat primary keys specially.
If the structure of the table reveals something like
primary_key INT PRIMARY KEY
or
primary_key INT AUTOINCREMENT
Then chances are that you won't be able to overwrite these values; you'll need to issue some UPDATEs instead.

I'm curious as to your reasoning of doing this -- it seems like if other tables have relationships with this one, arbitrarily hosing the data mayn't be such a good idea.