Gaetano Mendola wrote:
Tom Lane wrote:
We could fix this by changing the declarations of the "maxoff" variables
to int, but I think it's probably cleaner to recode
PageGetMaxOffsetNumber like so:
#define PageGetMaxOffsetNumber(page) \
(((PageHeader) (page))->pd_lower <= SizeOfPageHeaderData ? 0
Tom Lane wrote:
I was just looking at this macro:
/*
* PageGetMaxOffsetNumber
*Returns the maximum offset number used by the given page.
*Since offset numbers are 1-based, this is also the number
*of items on the page.
*
*NOTE: to ensure sane behavior if the pa
I was just looking at this macro:
/*
* PageGetMaxOffsetNumber
*Returns the maximum offset number used by the given page.
*Since offset numbers are 1-based, this is also the number
*of items on the page.
*
*NOTE: to ensure sane behavior if the page is not initi
Alvaro Herrera <[EMAIL PROTECTED]> writes:
> ppage = BufferGetPage(pbuf);
> pop = (BTPageOpaque) PageGetSpecialPointer(ppage);
> max = PageGetMaxOffsetNumber(pop);
I believe you want PageGetMaxOffsetNumber(ppage) ...
regards, tom lane
--
On Sun, 15 Dec 2002 23:49:57 -0300, Alvaro Herrera
<[EMAIL PROTECTED]> wrote:
>PageGetMaxOffsetNumber (the upper bound) returns a consistent value
>that's far too high (4294967291, 0xFFFB)
Alvaro, maybe this comment from bufpage.h can shed some light on it?
/*
* PageGetMaxOffsetNumber
* Re
On Sun, Dec 15, 2002 at 11:49:57PM -0300, Alvaro Herrera wrote:
> I iterate over the elements of the parent page in a for loop, and the
> upper bound is rarely reached because the item is found. However
> sometimes the item isn't found, and PageGetItem fails its assertion
> because the item isn't
Hello hackers,
I wonder what the PageGetMaxOffsetNumber macro is supposed to do (in a
btree index page)?
The scenario is the following: I need to get the pointer to a btree
page (leaf or internal) in its parent page, to call _bt_itemdel on it.
The only thing I can think of is to use its parent l