This fixes bug #18456 [1]. Since we're in back-branch release freeze,
I'll just park it for the moment. But I think we should shove it in
once the freeze lifts so it's in 17beta1.
regards, tom lane
[1] https://www.postgresql.org/message-id/18456-82d3d70134aefd28%40postgresql.org