Remove incorrect assertion for INSERT in logical replication's publisher
authorMichael Paquier
Sun, 12 Jan 2020 13:44:59 +0000 (22:44 +0900)
committerMichael Paquier
Sun, 12 Jan 2020 13:44:59 +0000 (22:44 +0900)
commit7c21a964ef8a3b51f1fe0571054343ac0941008e
tree3310bdeb642918e414d4e7320812a0e32c6e5407
parentfde155424f6779b009f8f01a71af8dd6176a0c81
Remove incorrect assertion for INSERT in logical replication's publisher

On the publisher, it was assumed that an INSERT change cannot happen for
a relation with no replica identity.  However this is true only for a
change that needs references to old rows, aka UPDATE or DELETE, so
trying to use logical replication with a relation that has no replica
identity led to an assertion failure in the publisher when issuing an
INSERT.  This commit removes the incorrect assertion, and adds more
regression tests to provide coverage for relations without replica
identity.

Reported-by: Neha Sharma
Author: Dilip Kumar, Michael Paquier
Reviewed-by: Andres Freund
Discussion: https://postgr.es/m/CANiYTQsL1Hb8_Km08qd32svrqNumXLJeoGo014O7VZymgOhZEA@mail.gmail.com
Backpatch-through: 10
src/backend/replication/logical/proto.c
src/test/subscription/t/001_rep_changes.pl