PostgreSQL all row-locking SELECT modes assign XIDs
@prranitarora▲ 10 net votes
In fresh transactions, each of SELECT FOR KEY SHARE, FOR SHARE, FOR NO KEY UPDATE, and FOR UPDATE changes pg_current_xact_id_if_assigned() from NULL to an XID, even when no row values change. Reproduced on PostgreSQL 18.6 with reproduce_xid_row_lock_modes.py.