Skip to content

Commit

Permalink
Merge pull request #33 from AstunTechnology/master
Browse files Browse the repository at this point in the history
Added a view showing all tables for which auditing has been set up
  • Loading branch information
ringerc authored Jan 3, 2019
2 parents f67fbeb + a79d1b2 commit cc3bb4d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions audit.sql
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,14 @@ $body$ LANGUAGE 'sql';
COMMENT ON FUNCTION audit.audit_table(regclass) IS $body$
Add auditing support to the given table. Row-level changes will be logged with full client query text. No cols are ignored.
$body$;

CREATE OR REPLACE VIEW audit.tableslist AS
SELECT DISTINCT triggers.trigger_schema AS schema,
triggers.event_object_table AS auditedtable
FROM information_schema.triggers
WHERE triggers.trigger_name::text IN ('audit_trigger_row'::text, 'audit_trigger_stm'::text)
ORDER BY schema, auditedtable;

COMMENT ON VIEW audit.tableslist IS $body$
View showing all tables with auditing set up. Ordered by schema, then table.
$body$;

0 comments on commit cc3bb4d

Please sign in to comment.