Re: Constraint Trigger's referenced_table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
Cc: General PostgreSQL List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Constraint Trigger's referenced_table
Date: 2007-12-23 19:20:24
Message-ID: 13985.1198437624@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Broersma Jr <rabroersma(at)yahoo(dot)com> writes:
> --- On Sat, 12/22/07, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> No, the purpose is to support foreign-key triggers. FK constraints are
>> implemented via cooperating triggers on the two tables, and
>> each trigger has to be able to look at the other table.

> When you say "each trigger has to be able to look" do you mean that each trigger needs to be notified when other table has records that are inserted/updated/deleted?

No, each trigger fires for events in its own table. It then has to go
look at the other table to see if the FK constraint holds (and,
depending on which trigger you are talking about, perhaps make it hold
by changing the other table).

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-12-23 19:25:27 Re: postgres UTC different from perl?
Previous Message Trevor Talbot 2007-12-23 18:55:26 Re: pgsql cannot read utf8 files moved from windows correctly!