The attached patch fixes the issue discussed in
<https://www.postgresql.org/message-id/flat/20170728120244.1449.87477%40wrigleys.postgresql.org>.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services