3 ms·
If you are doing an update the first word is actually BEGIN. /* use your PPE */ BEGIN; /* make the change */ UPDATE foo SET bar = ‘baz’; /* sanity ch
by mulmen 3y ago
If you are doing an update the first word is actually BEGIN.
/* use your PPE */
BEGIN;
/* make the change */
UPDATE foo SET bar = ‘baz’;
/* sanity check */
SELECT * FROM foo WHERE bar != ‘baz’;
/* oops, let’s pretend this never happened */
ROLLBACK;
- dotancohen 3y agoThat might help in dev, but nobody would use transactions when hand manipulating the live production database. ))