I wrote:> I guess we missed something about when it's safe to do this optimization.
I've applied the attached patch to fix this.
regards, tom lane