aboutsummaryrefslogtreecommitdiff
path: root/src/backend/replication/logical/decode.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/replication/logical/decode.c')
-rw-r--r--src/backend/replication/logical/decode.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/backend/replication/logical/decode.c b/src/backend/replication/logical/decode.c
index 00b5b838d7c..1734ec96599 100644
--- a/src/backend/replication/logical/decode.c
+++ b/src/backend/replication/logical/decode.c
@@ -608,6 +608,8 @@ DecodeInsert(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)
change->data.tp.newtuple);
}
+ change->data.tp.clear_toast_afterwards = true;
+
ReorderBufferQueueChange(ctx->reorder, r->xl_xid, buf->origptr, change);
}
@@ -673,6 +675,8 @@ DecodeUpdate(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)
#endif
}
+ change->data.tp.clear_toast_afterwards = true;
+
ReorderBufferQueueChange(ctx->reorder, r->xl_xid, buf->origptr, change);
}
@@ -710,6 +714,9 @@ DecodeDelete(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)
r->xl_len - SizeOfHeapDelete,
change->data.tp.oldtuple);
}
+
+ change->data.tp.clear_toast_afterwards = true;
+
ReorderBufferQueueChange(ctx->reorder, r->xl_xid, buf->origptr, change);
}
@@ -795,6 +802,9 @@ DecodeMultiInsert(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)
tuple->header.t_hoff = xlhdr->t_hoff;
}
+ /* reset toast reassembly only after the last chunk */
+ change->data.tp.clear_toast_afterwards = (i + 1) == xlrec->ntuples;
+
ReorderBufferQueueChange(ctx->reorder, r->xl_xid,
buf->origptr, change);
}