Fork me on GitHub

Hello I'm trying to write some test-fixtures to run my app and rollback after the test but I'm getting: ERROR: ROLLBACK TO SAVEPOINT can only be used in transaction blocks If it's really not possible, I would ask at least some more info about transaction blocks (and how they compose)


Transactions cannot be nested.


You're also trying to stand up two overlapping transactions on a single connection which cannot work.


Connections are auto-commit by default so single SQL operations do not need to be wrapped in a transaction -- you only need a (single) transaction wrapped around a group of SQL operations that you need to be atomically committed (or rolled back).