Dmitry Dolgov <9erthalion6(at)gmail(dot)com> writes:
> Thanks, I could reproduce this in v15 and v16. Interestingly enough it
> was fixed in d0d44049d1, but looks like due to lack of error reports the
> fix was applied only on the main branch. I assume this one makes it
> necessary to back-patch the fix.
Hah. Nothing like fixing a bug that you know is there but you can't
demonstrate it ;-). I confirm the problem appears in d0d44049d1^
(and at least as far back as v12), but not in d0d44049d1 or HEAD.
So yeah, add test case and back-patch.
Many thanks for the test case!
regards, tom lane