I just got around to merging this patch to 9.5 sources. I'm glad I
did it because in the course of doing so I noticed a bug in a recent
patch, which led to commit d5e3d1e969d2f65009f718d3100d6565f47f9112
(back-patched to 9.3).
I'm now more confident in this code and will probably push this a few
days, but only to 9.5 at least for now. It probably won't apply cleanly
to 9.3 due to other changes in the area, such as 05315498012530d44cd89a2
and df630b0dd5ea2de52972d456f5978a012436115e and others.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services