On 2017/06/20 20:37, Amit Kapila wrote:
> On Tue, Jun 20, 2017 at 1:50 PM, Amit Langote
> <langote_amit...@lab.ntt.co.jp> wrote:
>> On 2017/06/19 23:31, Tom Lane wrote:
>>> I'd suggest a rule like "if pd_lower is smaller than SizeOfPageHeaderData
>>> then don't trust it, but assume all of the page is valid data".
>>
>> Actually, such a check is already in place in the tool, whose condition
>> looks like:
>>
>>     if (PageGetPageSize(header) == BLCKSZ &&
>>         PageGetPageLayoutVersion(header) == PG_PAGE_LAYOUT_VERSION &&
>>         (header->pd_flags & ~PD_VALID_FLAG_BITS) == 0 &&
>>         header->pd_lower >= SizeOfPageHeaderData &&
>>         header->pd_lower <= header->pd_upper &&
>>         header->pd_upper <= header->pd_special &&
>>         header->pd_special <= BLCKSZ &&
>>         header->pd_special == MAXALIGN(header->pd_special) && ...
>>
>> which even GIN metapage passes, making it an eligible data page and hence
>> for omitting the hole between pd_lower and pd_upper.
>>
> 
> Won't checking for GIN_META in header->pd_flags gives you what you want?

GIN_META flag is not written into pd_flags but GinPageOpaqueData.flags,
which still requires including GIN's private header.

Thanks,
Amit



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to