Re: GIN pageinspect support for entry tree and posting tree - Mailing list pgsql-hackers

From Andrey Borodin
Subject Re: GIN pageinspect support for entry tree and posting tree
Date
Msg-id 798928DA-2937-46F5-8AD0-C3A5BAB5C7E1@yandex-team.ru
Whole thread Raw
In response to Re: GIN pageinspect support for entry tree and posting tree  (Kirill Reshke <reshkekirill@gmail.com>)
List pgsql-hackers
> On 29 Dec 2025, at 17:51, Kirill Reshke <reshkekirill@gmail.com> wrote:
>
> Attached v2

I've looked into the patch.
The functionality is useful and seems to reflect pageinspect style.

> Patch still is very raw, many things to improve.

Yup, but let's work on it!

Please update the documentation here [0].

Other AM's seems to defend from each other: if (!IS_INDEX(rel) || !IS_BTREE(rel)) or if (!IS_GIST(indexRel)). I don't
seesuch check in new functions. B-tree also protects from temp tables of other sessions: if
(RELATION_IS_OTHER_TEMP(rel)).

gin_datapage_items() seem to ignore reloid, did you have some ideas how to use it?

In gin_entrypage_items() buf and tmpTupdesc seem to be recreated for every offset, can we reuse them?

gin_entrypage_items() errors out with "input page is not a valid GIN data leaf page", but function is for entry pages.

There's no tests for gin_datapage_items().

There's a typo "unsuppoerted" and "rejrect" in gin.sql.

gin_entrypage_items() emits elog(NOTICE, "page is deleted"), but gin_datapage_items() does not.

Also, note that corresponding GiST code does "OffsetNumber maxoff = InvalidOffsetNumber;", but gin_entrypage_items()
hasno this initialization. 

I'd convert Assert(!isnull) into if+elog: inspected data might be corrupted.

Thanks!


Best regards, Andrey Borodin.


[0] https://www.postgresql.org/docs/current/pageinspect.html#PAGEINSPECT-GIN-FUNCS


pgsql-hackers by date:

Previous
From: Jeevan Chalke
Date:
Subject: Re: Add --extra-dependencies and immediate data dumping for pg_dump/pg_upgrade
Next
From: Robert Treat
Date:
Subject: Re: Get rid of "Section.N.N.N" on DOCs