This is not necessary anymore after
297d627e, but extensions that have
not been recompiled after the fix will not use the new definition of
heap_getattr(). While recompiling those extensions is obviously the
suggested course, it's cheap enough to retain the expansion in
GetTupleForTrigger().
Per suggestion from Andrew Gierth.
Discussion:
[email protected]
LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
}
- result = heap_copytuple(&tuple);
+ /*
+ * While this is not necessary anymore after 297d627e, as a defense
+ * against C code that has not recompiled for minor releases after the
+ * fix, continue to expand the tuple.
+ */
+ if (HeapTupleHeaderGetNatts(tuple.t_data) < relation->rd_att->natts)
+ result = heap_expand_tuple(&tuple, relation->rd_att);
+ else
+ result = heap_copytuple(&tuple);
ReleaseBuffer(buffer);
return result;