Hi Nathan,
I have done almost same thing locally for [1], but I thought your code seemed better.
Just One comment: IIUC the statement "ALTER SUBSCRIPTION" can be executed
inside the transaction. So if two subscriptions are altered in the same
transaction, only one of them will awake. Is it expected behavior?
I think we can hold a suboid list and record oids when the subscription are
altered, and then the backend process can consume all of list cells at the end of
the transaction.
How do you think?
[1]: https://commitfest.postgresql.org/40/3581/
Best Regards,
Hayato Kuroda
FUJITSU LIMITED