Laurenz Albe <laurenz.albe@cybertec.at> writes:
> I came up with the attached patch set.
I did some more work on the comments, adjusted a couple of places that
could be simplified, and pushed it.
> I used two separate patches for clarity and ease of review, but both
> should get backpatched.
I didn't really love the "fix it and then explain it afterward"
approach. It's hard to review a patch if you don't understand the
logic. I considered swapping the order of the two patches, but
eventually just merged them into one.
regards, tom lane