This patch looks reasonable to me. I have also seen occasional requests for this in the field.
If someone could test this on Windows, I think we could move ahead with it. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services