I need to run a script on every database change. The script works on diffs, so I need to know if I handled the previous state (the handler script could be down for some time for example).
One way I could implement it is to create a trigger on every change which would increment a sequence. Then I just check if
current_sequence_value == previous_sequence_value + 1.
I'm not that happy with making every single write require the sequence update, so the question is: can I get such "state version seq" using some kind of built-in metadata?