Re: Trigger before delete does fire before, but delete doesn't not happen

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adrian Klaver <aklaver(at)comcast(dot)net>
Cc: Stéphane A(dot) Schildknecht <stephane(dot)schildknecht(at)postgresqlfr(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: Trigger before delete does fire before, but delete doesn't not happen
Date: 2008-12-01 20:47:03
Message-ID: 562.1228164423@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adrian Klaver <aklaver(at)comcast(dot)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 for the row with id of 1. This means the original statement "delete from commande where id=1" runs against a version of the row that no longer exists and becomes a no-op statement. This happens because the trigger was run as BEFORE and changed the row from under the original statement.

Right.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Maxim Boguk 2008-12-01 21:00:52 Re: Indexes on NULL's and order by ... limit N queries
Previous Message Geoffrey 2008-12-01 20:43:01 Re: Monty on MySQL 5.1: "Oops, we did it again"