Generate changefiles from two osm files

I recently managed to import bulk of OSM data into PostgreSQL and work with it.
There is some data-cleaning process which will be so useful to automate using that.

I know in order to “write” changed files, I have to make changefiles. However, I’m not sure whether it’s possible in PostgreSQL or any other way. Any suggestions?