Re: HeapTupleData.t_self garbage values

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: HeapTupleData.t_self garbage values
Date: 2010-03-11 21:01:36
Message-ID: 4B9905D0020000250002FCAA@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Yeah, the correct TID value would be
> ItemPointerGetBlockNumber(tid) plus the current offnum.

Thanks!

> However we don't have enough information in this function to set
> t_tableOid correctly, so maybe it would be best to just set both
> fields invalid. Or do nothing --- AFAICS none of the uses of the
> heapTuple look at those fields. Is it worth a few extra cycles to
> initialize unused fields of a short-lived heapTuple?

At a minimum, it might be good to qualify the comment in htup.h and
add a comment where there is an exception. This can be startling in
a debugger if you don't know that the comment isn't really true.
(And I've found another place where t_tableOid isn't set, but it is
apparently benign; that's without an exhaustive search.)

I could put forward a comment-only patch per the above if there are
no objections.

-Kevin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-03-11 21:06:04 Re: [patch] build issues on Win32
Previous Message Tom Lane 2010-03-11 20:52:29 Re: HeapTupleData.t_self garbage values