John Naylor <john(dot)naylor(at)enterprisedb(dot)com> writes:
> Here's a draft fix for master, with regression tests.
Passes an eyeball check, though I didn't run the test.
> It will need a bit of
> massaging for the back branches -- the problem goes back at least to 9.6.
I'm sure it's quite ancient ... ecpg hasn't changed much in a Long Time.
regards, tom lane