▲ | magicalhippo 7 months ago | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Agreed, I've long been thinking that DELETE should require a WHERE clause. If you really want to just delete everything, just do WHERE 1=1. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | yen223 7 months ago | parent | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
It would be nice if there was a psql option that would warn you if you're about to do any kind of update, delete or insert without doing a BEGIN; (You could always set autocommit=false, which forces you to explicitly commit or rollback every action, but that has its own baggage) | |||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | buro9 7 months ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
UPDATEs should require a WHERE clause too. At which point we could just say all SQL should have a WHERE clause. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | 7 months ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
[deleted] |