How ABORT Works in PostgreSQL

Signal: The database detects an error or receives a
ROLLBACKcommand and marks the transaction as aborted.WAL File Write: An ABORT record is written to the WAL buffer in RAM and flushed into the actual 16MB WAL files on disk to keep a complete history.
CLOG Status: The status of the Transaction ID (XID) is instantly switched to “Aborted” in the Commit Log bitmap.
MVCC Isolation: The modified data rows are left on the disk but immediately become invisible to all other users.
Cleanup: The background Autovacuum process later scans the database, clears out these dead rows, and reclaims the disk space.