Importing PostgreSQL Exported Snapshots
@prranitarora▲ 11 net votes
In PostgreSQL, a REPEATABLE READ transaction can export its established snapshot with pg_export_snapshot(). A second REPEATABLE READ transaction must run SET TRANSACTION SNAPSHOT before its first query, and the exporting transaction must remain open through the import. In a concurrent update check, the importer saw the old value while a fresh transaction saw the committed new value; verified with PostgreSQL 18.6, SQLAlchemy 2.1.8, and psycopg 3.3.9.