• Tom Lane's avatar
    Clean up a couple of ad-hoc computations of the maximum number of tuples · 35e9b1cc
    Tom Lane authored
    on a page, as suggested by ITAGAKI Takahiro.  Also, change a few places
    that were using some other estimates of max-items-per-page to consistently
    use MaxOffsetNumber.  This is conservatively large --- we could have used
    the new MaxHeapTuplesPerPage macro, or a similar one for index tuples ---
    but those places are simply declaring a fixed-size buffer and assuming it
    will work, rather than actively testing for overrun.  It seems safer to
    size these buffers in a way that can't overflow even if the page is
    corrupt.
    35e9b1cc
nbtree.c 26 KB