Re: Wrap access to Oid in HeapTupleHeader - Mailing list pgsql-patches

From Tom Lane
Subject Re: Wrap access to Oid in HeapTupleHeader
Date
Msg-id 26228.1025718645@sss.pgh.pa.us
Whole thread Raw
In response to Re: Wrap access to Oid in HeapTupleHeader  (Manfred Koizar <mkoi-pg@aon.at>)
Responses Re: Wrap access to Oid in HeapTupleHeader
List pgsql-patches
Manfred Koizar <mkoi-pg@aon.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



pgsql-patches by date:

Previous
From: Manfred Koizar
Date:
Subject: Re: Wrap access to Oid in HeapTupleHeader
Next
From: Manfred Koizar
Date:
Subject: Re: Wrap access to Oid in HeapTupleHeader