pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Martin Lesser <ml-pgsql@bettercom.de>
Cc: pgsql-performance@postgresql.org
Subject: Re: Effects of cascading references in foreign keys
Date: Sat, 29 Oct 2005 09:48:35 -0500
Message-ID: <20051029144835.GA21068@wolff.to> (raw)
In-Reply-To: <87acgszihk.fsf@nb-aspire.bettercom.de>
References: <87acgszihk.fsf@nb-aspire.bettercom.de>

On Sat, Oct 29, 2005 at 13:10:31 +0200,
  Martin Lesser <ml-pgsql@bettercom.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.



view thread (17+ messages)  latest in thread

Message-ID: <20051029144835.GA21068@wolff.to>
Permalink:  ../20051029144835.GA21068@wolff.to/
Also on:    postgresql.org/message-id/20051029144835.GA21068@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: bruno@wolff.to, ml-pgsql@bettercom.de
  Subject: Re: Effects of cascading references in foreign keys
  In-Reply-To: <20051029144835.GA21068@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox