Fix issues with wide tuples being updated and REPLICA IDENTITY FULL.

When replica identity full is being used with a wide tuple (above 2^16
bytes after compression) it lead to errors and/or crashes during
decoding because the length field used to store such tuples doesn't
fit into the variable used to store the width in the WAL record.

To fix, discontinue use of xl_heap_header_len.t_len when decoding the
old tuple version, instead compute length of the old tuple by
subtracting the new tuple's length from the record length.

In newer version of postgres this issue is moot because the length is
stored by the new WAL machinery, instead of a xl_heap_header_len
struct.  A separate commit will forward-patch the regression test.

Reported-By: "anderson"



Modified Files
contrib/test_decoding/expected/toast.out |  8 +++++++-
contrib/test_decoding/sql/toast.sql      |  3 ++-
src/backend/access/heap/heapam.c         |  8 +++++++-
src/backend/replication/logical/decode.c | 19 ++++++++++++++++---
4 files changed, 32 insertions(+), 6 deletions(-)

Sent via pgsql-committers mailing list (
To make changes to your subscription:

Reply via email to