So we do something similar, using HSTORE to diff the old and new records, which then allows us to easily tell what was changed in the case of an update. Useful for many kinds of things, but especially forensics.
In my example, say a user edits their document and saves it (to a row in the DB). I want to be able to tell what their previous row was, what the new one is, and basically git diff them.
, HSTORE(oldData.*) - HSTORE(newData.*)
, HSTORE(newData.*) - HSTORE(oldData.*)
```
this is basically what we do, getting the old and new of only what changed.