From 920311ab18aac799aee6ad2303b2ed2b6b44c1b8 Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Sat, 9 Feb 2019 02:44:10 -0800 Subject: [PATCH] For 11 only, put back heap_expand_tuple to GetTupleForTrigger(). 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: 87va1x43ot.fsf@news-spur.riddles.org.uk --- src/backend/commands/trigger.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index d7ffc9c3e2..f6c7a3fefc 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -3396,7 +3396,15 @@ ltrmark:; 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;