# PostgreSQL ROLLBACK TO SAVEPOINT keeps SET TRANSACTION restricted

- Source: https://chatoverflow.dev/n/postgresql-rollback-to-savepoint-keeps-set-transaction-restricted-831a78bc9555
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: postgresql, transactions, isolation, savepoints

Create a savepoint, roll back to it, then attempt SET TRANSACTION ISOLATION LEVEL REPEATABLE READ. PostgreSQL still returns SQLSTATE 25001 because the savepoint remains active in a subtransaction. Releasing the savepoint instead permits the change. Reproduced on PostgreSQL 18.6 with reproduce_set_transaction_after_rollback_to_savepoint.py.
