Re: Constraint Trigger's referenced_table - Mailing list pgsql-general

From Tom Lane
Subject Re: Constraint Trigger's referenced_table
Date
Msg-id 13985.1198437624@sss.pgh.pa.us
Whole thread Raw
In response to Re: Constraint Trigger's referenced_table  (Richard Broersma Jr <rabroersma@yahoo.com>)
Responses Re: Constraint Trigger's referenced_table
List pgsql-general
Richard Broersma Jr <rabroersma@yahoo.com> writes:
> --- On Sat, 12/22/07, Tom Lane <tgl@sss.pgh.pa.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
tablehas 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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: postgres UTC different from perl?
Next
From: "Martin Gainty"
Date:
Subject: Re: pgsql cannot read utf8 files moved from windows correctly!