Closed jacobsvante closed 8 years ago
It should also be noted that this change requires an update of each audit_trigger_row
trigger as the feature works by making use of a WHEN
clause like this:
WHEN (current_setting('session_replication_role') <> 'local')
I've rebased all three pull requests that I've made now to only include the relevant code.
I'd suggest that they be merged in the following order:
Note that these changes will be have to be reapplied after #4 has been merged:
postgresql_audit/audit_table.sql
in this PR will have to be re-applied in postgresql_audit/templates/audit_table_func.sql
versioning_manager
fixture for this test: https://github.com/kvesteri/postgresql-audit/pull/8/files#diff-e8c010939a36969e585128cd96af94f3R141Also: As you can see I've included two new db_user
and db_name
fixtures in all of my PRs, as I've been unable to test with the postgres
user on my install.
Edit: I have merged all three here: https://github.com/jmagnusson/postgresql-audit/tree/jmagnusson. Just give me a shout if you run into any issues.
Thanks for the PR! :steam_locomotive:
There are cases where you might not want to track changes to your data, such as when doing big changes to a table. In those cases you can use the
VersioningManager.disable
context manager.Usage:
Note that this PR includes changes from #4. https://github.com/kvesteri/postgresql-audit/commit/607f06e38161a8c2c6a0ef1e9065dc06894fa898 contains the changes that touch this feature.
Inspiration found @ http://blog.endpoint.com/2015/07/selectively-firing-postgres-triggers.html