Re: Perfornamce Q

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Perfornamce Q
Date: 2003-01-23 06:38:07
Message-ID: 20030122223417.S7070-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Thu, 23 Jan 2003, Tom Lane wrote:

> Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp> writes:
> > But why would they be hurting me? The update is on a column that has no
> > constraints on it.
>
> Doesn't matter: any update will fire the foreign-key check trigger.
>
> Whether this is necessary or not I dunno, but someone's thought of
> it before: in the code I see
> /*
> * Note: We cannot avoid the check on UPDATE, even if old and new key
> * are the same. Otherwise, someone could DELETE the PK that consists
> * of the DEFAULT values, and if there are any references, a ON DELETE
> * SET DEFAULT action would update the references to exactly these
> * values but we wouldn't see that weired case (this is the only place
> * to see it).
> */

Since this is only necessary when the delete action is SET DEFAULT, I've
been planning to change it to always do the check on ON DELETE SET DEFAULT
or in other cases see if the key has changed and do the check only then.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2003-01-23 06:40:30 Re: Perfornamce Q
Previous Message Jean-Christian Imbeault 2003-01-23 06:01:45 Re: Perfornamce Q