From: Tom Lane Date: Tue, 16 Dec 2008 16:26:14 +0000 (+0000) Subject: Make heap_update() set newtup->t_tableOid correctly, for consistency with X-Git-Tag: REL8_3_6~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b33432a33b7b40053b7221eff7c38a5fae9ad740;p=postgresql Make heap_update() set newtup->t_tableOid correctly, for consistency with 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. --- diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 5994329dcc..9fcb1fe397 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.249.2.3 2008/09/11 14:01:35 alvherre Exp $ + * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.249.2.4 2008/12/16 16:26:14 tgl Exp $ * * * INTERFACE ROUTINES @@ -2483,6 +2483,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