]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix incorrect output from pgoutput when using column lists.
authorAmit Kapila <akapila@postgresql.org>
Fri, 2 Dec 2022 05:04:16 +0000 (10:34 +0530)
committerAmit Kapila <akapila@postgresql.org>
Fri, 2 Dec 2022 05:44:42 +0000 (11:14 +0530)
commitebf87c019c042a33cf9d2810c1fe360ddc7f8e93
treeec70d0fe36d63cca9699f4be179a387d38b7fe92
parent9377b4f30a14e1c79183b3138fa88fc99d4a872a
Fix incorrect output from pgoutput when using column lists.

For Updates and Deletes, we were not honoring the columns list for old
tuple values while sending tuple data via pgoutput. This results in
pgoutput emitting more columns than expected.

This is not a problem for built-in logical replication as we simply ignore
additional columns based on the relation information sent previously which
didn't have those columns. However, some other users of pgoutput plugin
may expect the columns as per the column list. Also, sending extra columns
unnecessarily consumes network bandwidth defeating the purpose of the
column list feature.

Reported-by: Gunnar Morling
Author: Hou Zhijie
Reviewed-by: Amit Kapila
Backpatch-through: 15
Discussion: https://postgr.es/m/CADGJaX9kiRZ-OH0EpWF5Fkyh1ZZYofoNRCrhapBfdk02tj5EKg@mail.gmail.com
src/backend/replication/logical/proto.c
src/backend/replication/pgoutput/pgoutput.c
src/include/replication/logicalproto.h
src/test/subscription/t/031_column_list.pl