News for hackers. Stuff that matters.
Re:I Accidentally Deleted All Our Data by YogSothoth on Friday November 18, 2011 @01:54PM (#3252860)
A buddy of mine showed me a cool trick to avoid this type of problem. What you do is first use SELECT to see the records in question:

   SELECT * from some_table where idx >= 5
Then, once you are staring at the records that came back (and are sure they are the ones you want to delete), change SELECT * to DELETE (and change nothing else) and rerun.

   DELETE from some_table where idx >= 5
Pretty hard to get it wrong with this approach ;-)
Re:I Accidentally Deleted All Our Data by mootothemax on Friday November 18, 2011 @03:15PM (#3253213)
Or even better, SELECT(*) FROM some_table - that way the developer won't be tempted to skip the step because of too many records scrolling through their screen... not that I learned that from personal experience or anything ;-)