Make heap_update() set newtup->t_tableOid correctly, for consistency with
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 16 Dec 2008 16:26:08 +0000 (16:26 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 16 Dec 2008 16:26:08 +0000 (16:26 +0000)
the other major heapam.c functions.  The only known consequence of this
omission is that UPDATE RETURNING failed to return the correct value for
"tableoid", as per report from KaiGai Kohei.

Back-patch to 8.2.  Arguably it's wrong all the way back; but without
evidence of visible breakage before RETURNING was added, I'll desist from
patching the older branches.

src/backend/access/heap/heapam.c

index 61b562d59ce3232df9733044a2b25225b2221918..610254bbc22d3019af593e68ba858a450be3e95c 100644 (file)
@@ -2604,6 +2604,7 @@ l2:
        HeapTupleHeaderSetXmin(newtup->t_data, xid);
        HeapTupleHeaderSetCmin(newtup->t_data, cid);
        HeapTupleHeaderSetXmax(newtup->t_data, 0);      /* for cleanliness */
+       newtup->t_tableOid = RelationGetRelid(relation);
 
        /*
         * Replace cid with a combo cid if necessary.  Note that we already put