"Nikolay Samokhvalov" <[EMAIL PROTECTED]> writes: > I don't understand how this can be called "not bug"... Please, help me > understand it :-)
The situation is that the DELETE arrives at a row after the trigger has already UPDATEd that row. You could make a reasonable case for throwing an error in this situation, but what we choose to do is assume that the trigger's action is correct. The row version that the DELETE would have acted on no longer "exists", so I don't really see that this violates the spec (bearing in mind that the spec doesn't know what MVCC is). I think the subtext of your complaint is that you'd like the DELETE to be applied to the updated row, but that doesn't hold any more water than what we do now. Consider the opposite case where the outer query is an UPDATE and the trigger DELETEs a row that the outer query will reach later --- it certainly isn't going to make sense to un-delete the row so we can update it. The only sensible choices here are to throw an error or do nothing. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings