Victor Petrovykh <victor(at)magic(dot)io> writes:
> I have one more related question: is a fix for this likely to appear in the
> next Postgres release?
Yes, it was pushed last week.
https://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=e473e1f2b
regards, tom lane