Attached a slightly updated version. It just has less spam in the regression tests, by adding a new option to test_decoding to show sequences, which it doesn't enable except in sequence specific tests.
Whoops, the patch as written is wrong. I used Form_pg_sequence's sequence_name field to get the sequence name. This seems to be a vestigial field with no useful purpose except taking up space; in particular, it's not updated when ALTER SEQUENCE ... RENAME TO is used to rename a sequence. The sequence's pg_class entry is updated but the sequence_name in the sequence page is not.
Since the sequence_name is written to WAL with each sequence recovery position advance, isn't used anywhere, and can be wrong, shouldn't it just be removed from Form_pg_sequence entirely? Or at least replaced with the sequence's pg_class entry oid?
I could always fix ALTER SEQUENCE to update sequence_name, but it seems pretty pointless to have it at all.
In any case I'll need to update this patch. Which will be fun, since the sequence oid doesn't seem to be written to the xlog record, just the HeapTuple header and Form_pg_sequence, and the redo is handled by doing a page replacement. I'd like to update Form_pg_sequence to store oid not sequence_name at the same time but that makes all this a dramatically more intrusive change that's rather less likely to be accepted.