Contents

A range of transactions can be reverted by calling:

sql SELECT pgmemento.revert_transactions(lower_txid, upper_txid);

It uses nearly the same query but with an additional ordering by transaction ids (DESC). When reverting many transactions an alternative procedure can be used called revert_distinct_transaction. For each distinct audit_it only the oldest table operation is applied to make the revert process faster. It is also provided for transaction ranges.

sql SELECT pgmemento.revert_distinct_transactions(lower_txid, upper_txid);

Note: If tables are created and dropped again during one transaction or a range of transactions revert_distinct_transaction is the better choice. Otherwise, the txid_range columns in tables audit_table_log and audit_column_log will be empty (but only if CREATE TABLE events are logged automatically).