Clean up a couple of ad-hoc computations of the maximum number of tuples

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 35e9b1cc1ee296959d52383455052cb3743af478
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2005-09-02T19:02:20Z
Releases: 8.1.0
Clean up a couple of ad-hoc computations of the maximum number of tuples
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.

Files