Can the application that initiates the change to the database notify your program?

I'm not that familiar with PostgreSQL, but doesn't it support notification events? Check the 'notify' command.

good luck