Heikki Linnakangas <heikki@enterprisedb.com> writes:
>> Hmm. There seems to be something wrong in the free space calculation in
>> the algorithm for choosing the right split location. I'll dig deeper,
>> unless someone beats me to it..
> I think I found it. The page splitting code didn't take into account
> that when the new item is the first one on the right page, it also
> becomes the high key of the left page. The fact that this test case
> triggered it in 32 bit machines and not on 64 bit machines was a
> coincidence.
> Patch attached.
Patch applied. I tried Joe's example with the maximum and minimum
possible fillfactors, and saw no failure, which may or may not prove
a lot. Are you still concerned about the PageGetFreeSpace issue?
regards, tom lane