3 ms·
In a company where we chose to do production SQL shenanigans in the spirit of "move fast, break things", I developed a habit of starting those with "BEGIN;" and
by taneliv 3y ago
In a company where we chose to do production SQL shenanigans in the spirit of "move fast, break things", I developed a habit of starting those with "BEGIN;" and paying careful attention to the number of records modified before calling it a "COMMIT;". In case of unexpected numbers, immediate "ROLLBACK;" so as to not hog the resources and make the applications suffer.
Even fatigued, "DELETE 1182900" tends to stick out, if you're used to, and expecting to, see "DELETE 1".
("BEGIN" appears to be PostgreSQLism, "START TRANSACTION" is more standard.)