🔁 Transaction Control
COMMIT, ROLLBACK and SAVEPOINT patterns for safe changes.
| Snippet | |
|---|---|
| ☆COMMIT — Make changes permanent |
COMMIT;
|
| ☆ROLLBACK — Undo all uncommitted changes |
ROLLBACK;
|
| ☆SAVEPOINT — Mark a mid-transaction restore point |
SAVEPOINT stage1;
|
| ☆ROLLBACK TO — Undo back to a savepoint |
ROLLBACK TO stage1;
|
| ☆SET TRANSACTION — Read-consistent transaction |
SET TRANSACTION READ ONLY;
|