getting oid of tuple in executePlan - Mailing list pgsql-hackers

From Dhruv Pilania
Subject getting oid of tuple in executePlan
Date
Msg-id Pine.GSO.4.33.0205191914120.26867-100000@compserv1
Whole thread Raw
In response to Re: Indexscan API cleanup proposal  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: getting oid of tuple in executePlan
List pgsql-hackers
Hello Mr. Lane,

I am a novice postgres developer. Can you please shed some light on this
problem I am having.

Basically, I am making a small change in executePlan() function of
executor/execMain.c. Right after a tupleslot is retrieved, I try to find
out the oid of the tuple that has been retrieved.

/* code that retrieves tupleslot */
/* snip */if (estate->es_useEvalPlan){            slot = EvalPlanQualNext(estate);            if (TupIsNull(slot))
             slot = ExecProcNode(plan, NULL);}else    slot = ExecProcNode(plan, NULL);
 
/* end of snip */

Right after this, I insert my code.
tupleOid = slot->val->t_data->t_oid;

For some reason, this assignment always results in tupleOid being 0. My
database has oid's enabled and I can see that an oid is assigned to each
tuple.

From what I understood, t_data is a pointer to the ondisk tuple so t_oid
should not be 0.

Can you please tell me what wrong assumptions I am making. Thank you for
your time and help.....

A budding postgresql developer,
Druv




pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: I am online today
Next
From: Joe Conway
Date:
Subject: SRF rescan testing