1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-14 18:42:34 +03:00

fix suppress_redundant_updates_trigger() where relation has Oids, per gripe from KaiGai Kohei

This commit is contained in:
Andrew Dunstan
2008-11-05 18:49:28 +00:00
parent e2a277bd08
commit b65ebc7e8b
3 changed files with 51 additions and 1 deletions

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/backend/utils/adt/trigfuncs.c,v 1.2 2008/11/04 00:29:39 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/trigfuncs.c,v 1.3 2008/11/05 18:49:27 adunstan Exp $
*
*-------------------------------------------------------------------------
*/
@ -62,6 +62,12 @@ suppress_redundant_updates_trigger(PG_FUNCTION_ARGS)
newheader = newtuple->t_data;
oldheader = oldtuple->t_data;
if (oldheader->t_infomask & HEAP_HASOID)
{
Oid oldoid = HeapTupleHeaderGetOid(oldheader);
HeapTupleHeaderSetOid(newheader, oldoid);
}
/* if the tuple payload is the same ... */
if (newtuple->t_len == oldtuple->t_len &&
newheader->t_hoff == oldheader->t_hoff &&
@ -77,5 +83,6 @@ suppress_redundant_updates_trigger(PG_FUNCTION_ARGS)
rettuple = NULL;
}
return PointerGetDatum(rettuple);
}