Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSQLtransactions BEGIN COMMITSingle-choice MCQ

Inside an explicit transaction, a statement fails with an error. What happens to subsequent statements in that same PostgreSQL transaction (with no savepoints)?

BEGIN; UPDATE accounts SET balance = balance - 100 WHERE id = 1; INSERT INTO ledger (acct, amt) VALUES (1, 'oops'); -- type error, fails SELECT * FROM accounts; -- run next COMMIT;