]> granicus.if.org Git - postgresql/commitdiff
Fix logical replication to fire BEFORE ROW DELETE triggers.
authorRobert Haas <rhaas@postgresql.org>
Thu, 12 Oct 2017 14:09:26 +0000 (10:09 -0400)
committerRobert Haas <rhaas@postgresql.org>
Thu, 12 Oct 2017 14:26:55 +0000 (10:26 -0400)
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

src/backend/executor/execReplication.c

index c26420ae103cf9dc6c4f59e5eb7dd99f92a48070..fb538c0297ba39c0d235b3dca83e8bbd7c5a617e 100644 (file)
@@ -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,