-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,25 @@ | ||
# pgtrail | ||
Auditing system for PostgreSQL | ||
|
||
# Description | ||
|
||
It creates new schema `pgtrail` which contains required functions and default audit storage table. | ||
You can use function `pgtrail.enable_audit('public.table_name')` for starting auditing changes of a table. | ||
This function will add a trigger to your table, which will be call on inserts, updates or deletes and will log | ||
all the information to default storage table `pgtrail.audit_changes`. | ||
|
||
You can see an example, by going to `examples/` and running `./run_example_docker.sh`. Example creates a table `employees` | ||
and fills it with some test data, after which applies some changes so audit is generated. The script will build docker container | ||
for the example, start it in detached mode and then would put you into `psql` tools where you can tinker with the database. | ||
For example, you can run `SELECT * FROM pgtrail.audit_changes;` to see all existing change. Alternatively you can use | ||
your favourite database management tool to connect to the container on standard port 5432. | ||
|
||
# Roadmap | ||
- Tests | ||
- Benchmarks | ||
- Implement functions to get state of a record at given time (by applying changes) | ||
- Implement automatic creation of storage table if it doesn't exist yet | ||
- Partitioning | ||
- Explore option for removing requirement of object_id to be uuid | ||
- Make it an extension (?) | ||
- Explore option for json metadata passing through transaction level 'current_setting("metadata)', fx for tracing id |