Table recording the history of INSERT, UPDATE, DELETE, and UNDO operations.
Each row records one provenance-tracked modification, linking the operation's provenance token to metadata (query TEXT, type, user, TIMESTAMP) and the temporal validity range of the affected rows.
A row of type TRANSACTION stands for the transaction the statements around it belong to (see provsql.transaction_token): xid is its transaction id and its own tx_token is NULL, while every statement row of that transaction carries the transaction's token in tx_token. A modified tuple's provenance names both – the effect is times(tx_token, statement_token) – so undo() reverses either one statement or the whole transaction, and the temporal semiring reads the transaction's validity through the shared factor.
ts and the lower bound of valid_time are stamped at commit, not at the statement: CURRENT_TIMESTAMP is the transaction's start time, so two overlapping transactions could otherwise commit in the opposite order of their recorded validity.
- Source code
- provsql.sql line 11062