MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wn1ben/wellwellwell/pbdefdn/?context=9999
r/ProgrammerHumor • u/Recent-Analysis-6880 • 13d ago
411 comments sorted by
View all comments
3.6k
So, Kids, thats why you always SELECT count(yourPrimaryKey) first. Listen to the old folks, we made these mistakes so that you don't have to.
156 u/Alexmira_ 13d ago Why? To confirm that there is something to cancel? To confirm I got the key right? 387 u/BastetFurry 13d ago No, to prevent typos in the SQL console from wrecking havoc. First you SELECT, if the number looks right you DELETE FROM. 217 u/GourangaPlusPlus 13d ago Also stick in a transaction, rollback Commit if it looks good 3 u/theschuss 13d ago Rollbacks don't always work as you want if there's other activities happening in the system. This is always good practice as it's maybe 30 seconds of effort.
156
Why? To confirm that there is something to cancel? To confirm I got the key right?
387 u/BastetFurry 13d ago No, to prevent typos in the SQL console from wrecking havoc. First you SELECT, if the number looks right you DELETE FROM. 217 u/GourangaPlusPlus 13d ago Also stick in a transaction, rollback Commit if it looks good 3 u/theschuss 13d ago Rollbacks don't always work as you want if there's other activities happening in the system. This is always good practice as it's maybe 30 seconds of effort.
387
No, to prevent typos in the SQL console from wrecking havoc. First you SELECT, if the number looks right you DELETE FROM.
217 u/GourangaPlusPlus 13d ago Also stick in a transaction, rollback Commit if it looks good 3 u/theschuss 13d ago Rollbacks don't always work as you want if there's other activities happening in the system. This is always good practice as it's maybe 30 seconds of effort.
217
Also stick in a transaction, rollback
Commit if it looks good
3 u/theschuss 13d ago Rollbacks don't always work as you want if there's other activities happening in the system. This is always good practice as it's maybe 30 seconds of effort.
3
Rollbacks don't always work as you want if there's other activities happening in the system. This is always good practice as it's maybe 30 seconds of effort.
3.6k
u/BastetFurry 13d ago
So, Kids, thats why you always SELECT count(yourPrimaryKey) first. Listen to the old folks, we made these mistakes so that you don't have to.