*** base/src/backend/utils/adt/trigfuncs.c.orig	2008-11-06 10:24:39.000000000 +0900
--- base/src/backend/utils/adt/trigfuncs.c	2008-11-06 10:29:41.000000000 +0900
***************
*** 69,77 ****
  	 * another OID value into newtuple.  (That's not actually possible at
  	 * present, but maybe someday.)
  	 */
!  	if (trigdata->tg_relation->rd_rel->relhasoids && 
! 		!OidIsValid(HeapTupleHeaderGetOid(newheader)))
! 		HeapTupleHeaderSetOid(newheader, HeapTupleHeaderGetOid(oldheader));
  
  	/* if the tuple payload is the same ... */
      if (newtuple->t_len == oldtuple->t_len &&
--- 69,83 ----
  	 * another OID value into newtuple.  (That's not actually possible at
  	 * present, but maybe someday.)
  	 */
! 	if (OidIsValid(HeapTupleGetOid(newtuple)) &&
! 		HeapTupleGetOid(newtuple) != HeapTupleGetOid(oldtuple))
! 		return PointerGetDatum(rettuple);	/* anyway, to be updated */
! 
! #if 0
! 	if (OidIsValid(HeapTupleGetSecurity(newtuple)) &&
! 		HeapTupleGetSecurity(newtuple) != HeapTupleGetSecurity(oldtuple))
! 		return PointerGetDatum(rettuple);	/* anyway, to be updated */
! #endif
  
  	/* if the tuple payload is the same ... */
      if (newtuple->t_len == oldtuple->t_len &&
***************
*** 80,88 ****
  		 HeapTupleHeaderGetNatts(oldheader)) &&
  		((newheader->t_infomask & ~HEAP_XACT_MASK) == 
  		 (oldheader->t_infomask & ~HEAP_XACT_MASK)) &&
! 		memcmp(((char *)newheader) + offsetof(HeapTupleHeaderData, t_bits),
! 			   ((char *)oldheader) + offsetof(HeapTupleHeaderData, t_bits),
! 			   newtuple->t_len - offsetof(HeapTupleHeaderData, t_bits)) == 0)
  	{
  		/* ... then suppress the update */
  		rettuple = NULL;
--- 86,94 ----
  		 HeapTupleHeaderGetNatts(oldheader)) &&
  		((newheader->t_infomask & ~HEAP_XACT_MASK) == 
  		 (oldheader->t_infomask & ~HEAP_XACT_MASK)) &&
! 		memcmp(((char *)newheader) + newheader->t_hoff,
! 			   ((char *)oldheader) + oldheader->t_hoff,
! 			   newtuple->t_len - newheader->t_hoff) == 0)
  	{
  		/* ... then suppress the update */
  		rettuple = NULL;
