News for hackers. Stuff that matters.
Re:My $500M Mars rover mistake by stickfigure on Tuesday November 28, 2023 @10:17PM (#38455043)
I have a rule when working on production databases: Always `start transaction` before doing any kind of update - and pay close attention to the # of rows affected.
Re:My $500M Mars rover mistake by jeremyjh on Tuesday November 28, 2023 @10:28PM (#38455140)
If you use postgres you can put

  \set AUTOCOMMIT off
In your .psqlrc and then you can never forget the begin transaction; every statement is already in a transaction, its just the default behaviour to automatically commit the statements for some ungodly reason.

Years ago I hired an experienced Oracle developer and put him to work right away on a SQL Server project. Oracle doesn't autocommit by default, and SQL Server does. You don't want to learn this when you type "rollback;". I took responsibility and we had all the data in an audit table and recovered quickly. I wonder if there are still people who call him "Rollback" though.

Re:My $500M Mars rover mistake by groestl on Wednesday November 29, 2023 @02:49AM (#38456683)
> its just the default behaviour

That's good from the DBA perspective, but relying on that default as a user is risky in itself, when you deal with multiple hosts and not all are set up this way.