Fix replica identity check for MERGE. When executing a MERGE, check that the target relation supports all actions mentioned in the MERGE command. Specifically, check that it has a REPLICA IDENTITY if it publishes updates or deletes and the MERGE command contains update or delete actions. Failing to do this can silently break replication.
Author: Zhijie Hou <[email protected]> Reviewed-by: Ashutosh Bapat <[email protected]> Reviewed-by: Dean Rasheed <[email protected]> Tested-by: Chao Li <[email protected]> Discussion: https://postgr.es/m/os3pr01mb57180c87e43a679a730482df94...@os3pr01mb5718.jpnprd01.prod.outlook.com Backpatch-through: 15 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5481cc332b0fc8ca242966813a6675a514c6917b Modified Files -------------- src/backend/executor/execMain.c | 27 ++++++++++++++++++++++++--- src/backend/executor/execPartition.c | 6 ++++-- src/backend/executor/nodeModifyTable.c | 6 +++++- src/include/executor/executor.h | 3 ++- src/test/regress/expected/publication.out | 28 ++++++++++++++++++++++++++++ src/test/regress/sql/publication.sql | 31 +++++++++++++++++++++++++++++++ 6 files changed, 94 insertions(+), 7 deletions(-)
