2ndQuadrant / audit-trigger

Simple, easily customised trigger-based auditing for PostgreSQL (Postgres). See also pgaudit.
Other
659 stars 241 forks source link

Query to display the data #23

Open polianomartini opened 8 years ago

polianomartini commented 8 years ago

The script was run and is operating normally.

I want to make a query to return the structure:

field | previous value | current value

When the action is equal to "Insert", to show the fields content only in the "current value" column.

Example:

field | previous value | current value

id | (Null) | 1 name | (Null) | Rick

When the action is equal to "Update."

Example:

field | previous value | current value

id | 1 | 1 name | (Null) | Richard

And finally "Delete":

field | previous value | current value

1 | 1 | (Null)