Great stuff. My only gripe is the pattern where the identifier needs to be re-installed when resetting the context. I don't think we need to hold push for that reason alone, but I bet we'll be revisiting that.
I suppose this infrastructure can be used to implement the idea in https://www.postgresql.org/message-id/camsr+yhii-bcc7ddpbb8fpcgzt0wmrt5gyz0w_kd_ft8rww...@mail.gmail.com in some more acceptable manner. I'm not proposing it for now, just parking the idea for a future patch. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services