Here's the patch I propose for commit. I also rewrote the commit
message.
There are further refinements that can be done, but they don't need to
be in the first patch. Notably, the event trigger code can surely do a
lot better now by translating the tag list to a bitmapset earlier.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services