Skip site navigation (1) Skip section navigation (2)

Re: Effects of cascading references in foreign keys

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Martin Lesser <ml-pgsql(at)bettercom(dot)de>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Effects of cascading references in foreign keys
Date: 2005-10-29 14:48:35
Message-ID: 20051029144835.GA21068@wolff.to (view raw or flat)
Thread:
Lists: pgsql-performance
On Sat, Oct 29, 2005 at 13:10:31 +0200,
  Martin Lesser <ml-pgsql(at)bettercom(dot)de> wrote:
> Which effects have UPDATEs on REFERENCEd TABLEs when only columns in the
> referenced table are updated which are not part of the FOREIGN KEY
> constraint?

In 8.1 there is a check to see if the foreign key value has changed and if
not a trigger isn't queued. In the currently released versions any update
will fire triggers.
The check in comment for trigger.c didn't say if this optimization applied
to both referencing and referenced keys or just one of those.
If you need to know more you can look at the code at:
http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/
for trigger.c.

In response to

Responses

pgsql-performance by date

Next:From: Bruno Wolff IIIDate: 2005-10-29 14:49:47
Subject: Re: Effects of cascading references in foreign keys
Previous:From: Michael FuhrDate: 2005-10-29 14:24:32
Subject: Re: Effects of cascading references in foreign keys

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group