Re: FK triggers misused? - Mailing list pgsql-performance

From Stephan Szabo
Subject Re: FK triggers misused?
Date
Msg-id 20070421090141.R65163@megazone.bigpanda.com
Whole thread Raw
In response to Re: FK triggers misused?  (cluster <skrald@amossen.dk>)
List pgsql-performance
On Sat, 21 Apr 2007, cluster wrote:

> I have investigated a bit now and found the following:
>
> When I perform the update the *first* time, the triggers are actually
> not evaluated. But from the second update they are.

Are these in one transaction? If so, then right now after the first
update, the remaining updates will trigger checks if the row modified was
modified in this transaction.  The comment in trigger.c lists the basic
circumstance, although it mentions it in terms of insert and a deferred
FK, I would guess that if there's ever a possibility of two modifications
(including multiple updates or on an immediate constraint) before the
constraint check occurred the same condition could happen.

pgsql-performance by date:

Previous
From: Colin McGuigan
Date:
Subject: Odd problem with planner choosing seq scan
Next
From: Tom Lane
Date:
Subject: Re: Odd problem with planner choosing seq scan