Re: FK triggers misused?

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: cluster <skrald(at)amossen(dot)dk>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: FK triggers misused?
Date: 2007-04-21 16:18:16
Message-ID: 20070421090141.R65163@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2007-04-21 17:06:37 Re: Odd problem with planner choosing seq scan
Previous Message Colin McGuigan 2007-04-21 15:33:38 Odd problem with planner choosing seq scan