I wrote:
> ... but this solution is astonishingly ugly. I think we should move up
> the LocalSetXLogInsertAllowed call, instead.
Specifically, I propose this patch instead. I'm not set up to try the
test case though, can you do that?
regards, tom lane