"Hiroshi Inoue" <Inoue@tpf.co.jp> writes:
> The following patch seems to fix your case.
> However I'm not sure it's a right solution.
That looks like nearly the same logic that I arrived at, although
what I committed included some additional code cleanups. As I said
in my prior message, I don't fully trust it yet --- but I am glad
you came to the same conclusion.
regards, tom lane