~/ learn/ postgresql/ cards/ Transactions & savepoints
1 of 2

Set a savepoint, set book 1’s price to 0, roll back to the savepoint, then show book 1’s price (it should be unchanged). Column: price.

Set a savepoint, set book 1’s price to 0, roll back to the savepoint, then show book 1’s price (it should be unchanged). Column: price.

Answer

SAVEPOINT sp1; UPDATE books SET price = 0 WHERE id = 1; ROLLBACK TO SAVEPOINT sp1; SELECT price FROM books WHERE id = 1;

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/0e49a667-5da4-4607-b77c-d364578918bc/flashcard utf-8 LF