Re: Wrap access to Oid in HeapTupleHeader

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Manfred Koizar <mkoi-pg(at)aon(dot)at>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Wrap access to Oid in HeapTupleHeader
Date: 2002-07-03 17:50:45
Message-ID: 26228.1025718645@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Manfred Koizar <mkoi-pg(at)aon(dot)at> writes:
> Where should DEBUG_TUPLE_ACCESS be defined or undef'd?

It doesn't need to be anywhere, but you could add it to pg_config.h.in
near line 308, where there are other similar symbols, eg
/* #define ACLDEBUG */

> As regards your complaint about the patch making oid access dependent
> on Relation, my POV is, that I did not introduce this dependence;
> currently whether a tuple header is supposed to contain a valid oid or
> not (apart from the fact, that it has a t_oid field anyway) *is*
> dependent on Relation-...->hasoids, we have nothing better to look at.

My point is that in the existing code, you can fetch t_oid and be sure
you will get 0 (and not either garbage or a crash) if no valid OID has
been assigned; this is relied on in several places that do not have
access to a Relation. To do the same in your proposed change, those
places will need more knowledge. They can't just blindly fetch from
tuple + t_hoff - sizeof(Oid).

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Jie Liang 2002-07-03 19:03:27 Re: pg_restore cannot restore function
Previous Message Manfred Koizar 2002-07-03 17:24:43 Re: Wrap access to Oid in HeapTupleHeader