Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
> Yes, that was the idea. Here is an adjusted patch.
Looks OK to me as far as the leak issue goes. I have no opinion on
whether this is adequate in respect to cleanup-after-error problems.
regards, tom lane