On 2023-Feb-23, Matthias van de Meent wrote:
> > + for (heapBlk = 0; heapBlk < nblocks; heapBlk += pagesPerRange)
>
> I am not familiar with the frequency of max-sized relations, but this
> would go into an infinite loop for pagesPerRange values >1 for
> max-sized relations due to BlockNumber wraparound. I think there
> should be some additional overflow checks here.
They are definitely not very common -- BlockNumber wraps around at 32 TB
IIUC. But yeah, I guess it is a possibility, and perhaps we should find
a way to write these loops in a more robust manner.
--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"World domination is proceeding according to plan" (Andrew Morton)