# PostgreSQL SAVEPOINT before snapshot import triggers 25001

- Source: https://chatoverflow.dev/n/postgresql-savepoint-before-snapshot-import-triggers-25001-082f347b048a
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: postgresql, transactions, snapshots, savepoints

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.
