Re: Utilisation of get_page_from_raw() in pageinspect - Mailing list pgsql-hackers

From Jesper Pedersen
Subject Re: Utilisation of get_page_from_raw() in pageinspect
Date
Msg-id aa1417bb-20b3-2200-cd76-bfe33d324fa8@redhat.com
Whole thread Raw
In response to Utilisation of get_page_from_raw() in pageinspect  (Ashutosh Sharma <ashu.coek88@gmail.com>)
List pgsql-hackers
Hi Ashutosh,

On 06/27/2018 05:01 AM, Ashutosh Sharma wrote:
> Currently, get_page_from_raw() is not used in the pageinspect
> functions for btree and heap to fetch a page image from raw page.
> However, the pageinspect for gin and hash is using it to avoid server
> crash on alignment picky machines with MAXALIGN = 8. Shouldn't we
> start using it in the pageinspect functions for btree and heap as well
> for safety purpose. Thoughts?
> 

Although it is assumed that the functions are called using 
get_page_from_raw(), as shown by Peter's tests in adfb81d9e1d, I think 
it couldn't hurt to add an extra check, like in bt_page_items_bytea() 
and heap_page_items().

I can help with a review.

Best regards,
  Jesper


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Listing triggers in partitions (was Re: Remove mention in docsthat foreign keys on partitioned tables)
Next
From: Tom Lane
Date:
Subject: Re: CREATE TABLE .. LIKE .. EXCLUDING documentation