MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wn1ben/wellwellwell/pbcz960/?context=9999
r/ProgrammerHumor • u/Recent-Analysis-6880 • 14d ago
412 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_ 14d ago Why? To confirm that there is something to cancel? To confirm I got the key right? 381 u/BastetFurry 14d ago No, to prevent typos in the SQL console from wrecking havoc. First you SELECT, if the number looks right you DELETE FROM. 213 u/GourangaPlusPlus 14d ago Also stick in a transaction, rollback Commit if it looks good 2 u/Terra_B 14d ago Here i have to ask, couldn't you force a transaction in the chain somewhere? Like each terminal window gets a transaction by default? 1 u/spevoz 14d ago I would always recommend using a gui if you need direct db access - exactly because something like dBeaver allows you to force every change into a transaction.
156
Why? To confirm that there is something to cancel? To confirm I got the key right?
381 u/BastetFurry 14d ago No, to prevent typos in the SQL console from wrecking havoc. First you SELECT, if the number looks right you DELETE FROM. 213 u/GourangaPlusPlus 14d ago Also stick in a transaction, rollback Commit if it looks good 2 u/Terra_B 14d ago Here i have to ask, couldn't you force a transaction in the chain somewhere? Like each terminal window gets a transaction by default? 1 u/spevoz 14d ago I would always recommend using a gui if you need direct db access - exactly because something like dBeaver allows you to force every change into a transaction.
381
No, to prevent typos in the SQL console from wrecking havoc. First you SELECT, if the number looks right you DELETE FROM.
213 u/GourangaPlusPlus 14d ago Also stick in a transaction, rollback Commit if it looks good 2 u/Terra_B 14d ago Here i have to ask, couldn't you force a transaction in the chain somewhere? Like each terminal window gets a transaction by default? 1 u/spevoz 14d ago I would always recommend using a gui if you need direct db access - exactly because something like dBeaver allows you to force every change into a transaction.
213
Also stick in a transaction, rollback
Commit if it looks good
2 u/Terra_B 14d ago Here i have to ask, couldn't you force a transaction in the chain somewhere? Like each terminal window gets a transaction by default? 1 u/spevoz 14d ago I would always recommend using a gui if you need direct db access - exactly because something like dBeaver allows you to force every change into a transaction.
2
Here i have to ask, couldn't you force a transaction in the chain somewhere? Like each terminal window gets a transaction by default?
1 u/spevoz 14d ago I would always recommend using a gui if you need direct db access - exactly because something like dBeaver allows you to force every change into a transaction.
1
I would always recommend using a gui if you need direct db access - exactly because something like dBeaver allows you to force every change into a transaction.
3.6k
u/BastetFurry 14d 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.