Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

At a previous place I worked, if they were working on the cli (eg in psql or similar) they'd always use these two steps, either of which would provide adequate protection:

1. Start a transaction before even thinking of writing the delete/update/etc (BEGIN; ...)

2. Always write the WHERE query out first, THEN go back to the start of the line and fill out the DELETE/UPDATE/etc.

It worked well, and it's a habit I've since tried to keep on doing myself as well.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: