> On 29 Dec 2025, at 17:51, Kirill Reshke <[email protected]> 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 see such 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() has no 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

Reply via email to