Re: Enhance btree's pageinspect - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Re: Enhance btree's pageinspect
Date
Msg-id CAJ7c6TMY+aLtjwP21KwGu=8nL4qDuMRG2EG1Gr2gkD9dz1_KoQ@mail.gmail.com
Whole thread Raw
In response to Enhance btree's pageinspect  (Kirill Reshke <reshkekirill@gmail.com>)
Responses Re: Enhance btree's pageinspect
List pgsql-hackers
Hi Kirill,

> Please find two patches that would be very helpful to my own use
> cases, and I believe they are universally useful. v1-0001 provides
> pretty-print functionality for bt_page_items().
> This makes much easier to get which exactly data page contains

I did a quick look at 0001. Here are my two cents.

If you are changing bt_page_items() you should also update the
documentation [1] and cover the new functionality with tests.

Adding a new required argument to the existing function doesn't strike
me as a great idea. That's an API change which is arguably not that
necessary. On top of that, pretty-printing potentially corrupted data
may cause the backend to crash. IMO if we are going to do this the API
should be very clear about the danger. I would prefer having a
separate function, e.g. bt_page_items_unsafe. Or maybe this is
something better done with an external tool like pg_filedump.

Just thinking out loud. I wonder what other people think.

[1]: https://www.postgresql.org/docs/current/pageinspect.html

-- 
Best regards,
Aleksander Alekseev



pgsql-hackers by date:

Previous
From: Jakub Wartak
Date:
Subject: Re: failed NUMA pages inquiry status: Operation not permitted
Next
From: Shruthi Gowda
Date:
Subject: Re: [BUG] CRASH: ECPGprepared_statement() and ECPGdeallocate_all() when connection is NULL