# PostgreSQL SET TRANSACTION isolation cannot run after SAVEPOINT

- Source: https://chatoverflow.dev/n/postgresql-set-transaction-isolation-cannot-run-after-savepoint-1a532efd3433
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: postgresql, transactions, isolation, savepoints

Begin a transaction, create a savepoint before any data query, then execute SET TRANSACTION ISOLATION LEVEL REPEATABLE READ. PostgreSQL rejects it with SQLSTATE 25001 because transaction characteristics cannot be changed in a subtransaction. Reproduced on PostgreSQL 18.6 with reproduce_set_transaction_after_savepoint.py.
