Sent proper patch to pgsql-hackers mailing list, at:
https://www.postgresql.org/message-id/flat/2edb7a57-b225-3b23-a680-62ba90658fec%40gmx.net