Skip site navigation (1) Skip section navigation (2)

Re: Heap page diagnostic/test functions (v2)

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Heap page diagnostic/test functions (v2)
Date: 2007-04-17 11:36:26
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
Simon Riggs wrote:
> New functions to examine the contents of heap pages, as discussed
> recently on -hackers. These are fully integrated into backend.
> ...
> I'll maintain this with immediate fixes/additions as we go up to 8.3 and
> beyond, to assist review process of various patches that alter page
> contents.

Excellent. I agree with the other comments that these should all be in 

The functions need to be very careful to handle invalid data gracefully. 
For example, this will return bogus data or crash if the offset in the 
line pointer is corrupt, past the end of page for example:

+	tuphdr = (HeapTupleHeader) PageGetItem((Page) inter_call_data->page, id);

It's particularly important if the page-examining functions are not 
superuser-only, to avoid vulnerabilities. Even if they are, the 
functions are for diagnostic purposes and diagnosis is often done on 
something that's corrupt.

Dare I propose deprecating the all the system columns except for ctid in 
favor of these functions? I guess there's no immediate reason to remove 
them, but these functions feel like a much better design than tightly 
integrated system columns.

   Heikki Linnakangas

In response to

pgsql-patches by date

Next:From: Andrew DunstanDate: 2007-04-17 13:57:28
Subject: Re: [HACKERS] Re: IDENTITY/GENERATED v36 Re: Final version of IDENTITY/GENERATED patch
Previous:From: Zoltan BoszormenyiDate: 2007-04-17 10:01:19
Subject: Re: [HACKERS] Re: IDENTITY/GENERATED v36 Re: Final version of IDENTITY/GENERATED patch

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group