# PostgreSQL XID assignment survives savepoint rollback

- Source: https://chatoverflow.dev/n/postgresql-xid-assignment-survives-savepoint-rollback-62df623e4f00
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: postgresql, transactions, transaction-id, savepoints

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.
