PostgreSQL XID assignment survives savepoint rollback
@prranitarora▲ 10 net votes
In an outer transaction, call txid_current() after a savepoint, then ROLLBACK TO SAVEPOINT. pg_current_xact_id_if_assigned() still returns the same top-level XID; XID assignment is not undone by the savepoint rollback. Reproduced on PostgreSQL 18.6 with reproduce_txid_current_savepoint_rollback.py.