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

Lines changed: 5 additions & 6 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy