From aff368546da06f038e4fb5d1c61bbf094dd78944 Mon Sep 17 00:00:00 2001 From: "Hou Zhijie" Date: Thu, 4 Aug 2022 17:18:25 +0800 Subject: [PATCH] fix RI check for partitioned table --- src/backend/executor/execReplication.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/backend/executor/execReplication.c b/src/backend/executor/execReplication.c index b000645..865bd7a 100644 --- a/src/backend/executor/execReplication.c +++ b/src/backend/executor/execReplication.c @@ -569,6 +569,13 @@ CheckCmdReplicaIdentity(Relation rel, CmdType cmd) { PublicationDesc pubdesc; + /* + * We only need to check the replica identity for leaf partition as + * operations are actually performed on leaf partitions. + */ + if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) + return; + /* We only need to do checks for UPDATE and DELETE. */ if (cmd != CMD_UPDATE && cmd != CMD_DELETE) return; -- 2.7.2.windows.1