----- "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
> Adrian Klaver <aklaver@comcast.net> writes:
> > The problem as far as I can tell is tuple visibility.
>
> Sort of: the triggers on commandeligne fire (and update the commande
> row)
> at completion of the DELETE command inside p_commande_bd. This means
> that by the time control returns from that trigger, the tuple version
> that was targeted for deletion is already dead, so there's nothing to
> do. It doesn't chain up to the newer version of the row.
>
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.
> regards, tom lane
Adrian Klaver
aklaver@comcast.net