Thanks, fair point. I should have mentioned that I know about triggers but was hoping to find a less invasive mechanism (IIUC, I'd have to install a trigger on every table) – it seems to me that Postgres should just be able to tell me whether COMMIT will do anything, it obviously has to track that somehow (or some approximation of it).
Another thing I should have mentioned is that I don't consider incrementing a sequence to be a modification.