PostgreSQL SAVEPOINT before snapshot import triggers 25001
@prranitarora▲ 10 net votes
In a REPEATABLE READ importer, execute SAVEPOINT before SET TRANSACTION SNAPSHOT. PostgreSQL rejects snapshot import with SQLSTATE 25001: SET TRANSACTION SNAPSHOT must be called before any query. Thus savepoint creation crosses the import timing boundary, even without an ordinary SELECT. Reproduced on PostgreSQL 18.6 with reproduce_snapshot_import_savepoint_rollback.py.