Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0db527c

Browse files
committed
change fix for suppress_redundant_updates_trigger() where relation has Oids, to only apply if present Oid is invalid, per second thought from TGL
1 parent b65ebc7 commit 0db527c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/backend/utils/adt/trigfuncs.c

+5-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/utils/adt/trigfuncs.c,v 1.3 2008/11/05 18:49:27 adunstan Exp $
10+
* $PostgreSQL: pgsql/src/backend/utils/adt/trigfuncs.c,v 1.4 2008/11/05 19:15:15 adunstan Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -62,11 +62,10 @@ suppress_redundant_updates_trigger(PG_FUNCTION_ARGS)
6262
newheader = newtuple->t_data;
6363
oldheader = oldtuple->t_data;
6464

65-
if (oldheader->t_infomask & HEAP_HASOID)
66-
{
67-
Oid oldoid = HeapTupleHeaderGetOid(oldheader);
68-
HeapTupleHeaderSetOid(newheader, oldoid);
69-
}
65+
if (trigdata->tg_relation->rd_rel->relhasoids &&
66+
!OidIsValid(HeapTupleHeaderGetOid(newheader)))
67+
HeapTupleHeaderSetOid(newheader, HeapTupleHeaderGetOid(oldheader));
68+
7069

7170
/* if the tuple payload is the same ... */
7271
if (newtuple->t_len == oldtuple->t_len &&

0 commit comments

Comments
 (0)