Perl saved my bacon

runrig on 2003-05-22T17:01:05

It was all my fault. At a client site, I did some sql updates 'where field_name is not null'. Shoulda been 'where field_name is null'. Luckily, I unloaded the table before and after the updates. I could probably just drop and reload the entire table, but that makes me a bit uncomfortable (more uncomfortable than the screwup I just did). Unfortunately, the client doesn't have perl installed. So I uucp the unload files to my box (anyone else still use uucp?), look for only the records I changed, and generate some sql to change'em back. When I first did the updates, it said about 25,000 rows were updated, which included rows where the old values were the same as the new values. It turned out there were only about 300 rows that were actually changed.

I think only about 3 of our customers have perl installed; I wish they all did. And I wish we had ssh/scp access to all of them too...(though one of them still allows telnet access...eek).