Re: GIN pageinspect support for entry tree and posting tree

From: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: GIN pageinspect support for entry tree and posting tree
Date: 2026-01-01 14:00:00
Message-ID: 798928DA-2937-46F5-8AD0-C3A5BAB5C7E1@yandex-team.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> On 29 Dec 2025, at 17:51, Kirill Reshke <reshkekirill(at)gmail(dot)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 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Treat 2026-01-01 14:57:15 Re: Get rid of "Section.N.N.N" on DOCs
Previous Message Jeevan Chalke 2026-01-01 13:43:25 Re: Add --extra-dependencies and immediate data dumping for pg_dump/pg_upgrade