kvesteri / postgresql-audit

Audit trigger for PostgreSQL
BSD 2-Clause "Simplified" License
126 stars 28 forks source link

Bulk deletes not tracked in transaction table #33

Open zwerg44 opened 5 years ago

zwerg44 commented 5 years ago

postgresql-audit version: 0.10.0 Postgresql version: 9.6.10 Sqlalchemy version: 1.2.7

Looks like bulk delete operations are tracked in activity table, but not tracked in transaction table. So using flask versioning_manager, we can't find out actor_id.

Example:

to_delete = (
    db_session.query(Model)
    .filter(Model.some_id.in_([1,2,3]))
)
to_delete.delete(synchronize_session='fetch')

I think this issue is related to #174