Testing the Audit Trigger
Explore how to test audit triggers with the hstore extension to monitor changes in a PostgreSQL table. Learn to execute queries that display updates and inserts, review change details for auditing, and understand how these triggers help track data modifications efficiently.
We'll cover the following...
We'll cover the following...
Viewing the updates in the artists table
With that in place, let’s try it out:
This SQL statement outputs the following information:
BEGIN
CREATE TABLE
COPY 15226
updates │ inserts
═════════╪═════════
52 │ 61
(1 row)
COMMIT
And thanks to our audit trigger, we can have a look at what’s changed:
Here are the ...