--- On Sat, 12/22/07, Tom Lane <[EMAIL PROTECTED]> 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?
 
>From what I gathered from the reading of ri_triggers.c, FWIU it seems that 
>this kind of cross table checking is designed to seek out any FKs or PKs in 
>the related table and then execute a validating query that compares the PK to 
>FK.
 
Can this kind of cross checking still be implemented for temporal relations 
where foreign keys are not actually implemented in the "referencing" table.
 
For example I want to enforce the primary-relation's time range to always 
engulf the time range of the foreign-relation.:
PK timeline:
 
|---p1---|--p2--|-p3-|p4|---p5---|

FK timeline:
  |-f1-|----f2----|--f3--|--f4--|

So if I INSERT/UPDATE/DELETE records to either table, would implementing the 
"FROM referenced_table" predicated of the CREATE Constraint Trigger enable this 
kind of notification to perform cross checking even though there are strictly 
no pk/fk relations between these table?

Regards,
Richard Broersma Jr.

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to