Hi,
Thanks for the report and the analysis. I have proposed a patch for
this on pgsql-hackers[1]. Please take a look.
Thanks,
Nitin Motiani
Google
[1] https://www.postgresql.org/message-id/flat/CAH5HC97y7PFE6rJh8kVDUszPxGQE030nZvyHu%3DwZT7FBkOV3qA%40mail.gmail.com