From: Robert Haas Date: Thu, 12 Oct 2017 14:09:26 +0000 (-0400) Subject: Fix logical replication to fire BEFORE ROW DELETE triggers. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=360fd1a7b2fe779cc9e696b813b12f6a8e83b558;p=users%2Fbernd%2Fpostgres.git Fix logical replication to fire BEFORE ROW DELETE triggers. Before, that would fail to happen unless a BEFORE ROW UPDATE trigger was also present. Noted by me while reviewing a patch from Masahiko Sawada, who also wrote this patch. Reviewed by Petr Jelinek. Discussion: http://postgr.es/m/CA+TgmobAZvCxduG8y_mQKBK7nz-vhbdLvjM354KEFozpuzMN5A@mail.gmail.com --- diff --git a/src/backend/executor/execReplication.c b/src/backend/executor/execReplication.c index c26420ae10..fb538c0297 100644 --- a/src/backend/executor/execReplication.c +++ b/src/backend/executor/execReplication.c @@ -511,7 +511,7 @@ ExecSimpleRelationDelete(EState *estate, EPQState *epqstate, /* BEFORE ROW DELETE Triggers */ if (resultRelInfo->ri_TrigDesc && - resultRelInfo->ri_TrigDesc->trig_update_before_row) + resultRelInfo->ri_TrigDesc->trig_delete_before_row) { skip_tuple = !ExecBRDeleteTriggers(estate, epqstate, resultRelInfo, &searchslot->tts_tuple->t_self,