Re: Trigger before delete does fire before, but delete doesn't not happen - Mailing list pgsql-general

From Tom Lane
Subject Re: Trigger before delete does fire before, but delete doesn't not happen
Date
Msg-id 562.1228164423@sss.pgh.pa.us
Whole thread Raw
In response to Re: Trigger before delete does fire before, but delete doesn't not happen  (Adrian Klaver <aklaver@comcast.net>)
Responses Re: Trigger before delete does fire before, but delete doesn't not happen
List pgsql-general
Adrian Klaver <aklaver@comcast.net> writes:
> Thanks for the explanation. Just so I am clear,the act of updating the row in p_commandeligne_ad creates a new tuple
forthe row with id of 1. This means the original statement "delete from commande where id=1" runs against a version of
therow that no longer exists and becomes a no-op statement. This happens because the trigger was run as BEFORE and
changedthe row from under the original statement. 

Right.

            regards, tom lane

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Indexes on NULL's and order by ... limit N queries
Next
From: Geoffrey
Date:
Subject: Re: Monty on MySQL 5.1: "Oops, we did it again"