Re: [GENERAL] Constraint Trigger's referenced_table

2007-12-23 Thread Richard Broersma Jr
--- On Sun, 12/23/07, Tom Lane <[EMAIL PROTECTED]> wrote: > (and, depending on which trigger you are talking about, perhaps > make it hold by changing the other table). Okay, I take it that changing the other table would only apply to tables that were designed with foreign key constraints that

Re: [GENERAL] Constraint Trigger's referenced_table

2007-12-23 Thread Tom Lane
Richard Broersma Jr <[EMAIL PROTECTED]> writes: > --- 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 t

Re: [GENERAL] Constraint Trigger's referenced_table

2007-12-23 Thread Richard Broersma Jr
--- 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

Re: [GENERAL] Constraint Trigger's referenced_table

2007-12-22 Thread Richard Broersma Jr
--- On Sat, 12/22/07, Tom Lane <[EMAIL PROTECTED]> wrote: > There's always the source code: > src/backend/utils/adt/ri_triggers.c Thanks. I will do my best and give it a try :-) ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ?

Re: [GENERAL] Constraint Trigger's referenced_table

2007-12-22 Thread Tom Lane
Richard Broersma Jr <[EMAIL PROTECTED]> writes: > Does any documentation exist that I could spend some time reading that > explains detail the cooperation between triggers on the two tables? There's always the source code: src/backend/utils/adt/ri_triggers.c regards, tom

Re: [GENERAL] Constraint Trigger's referenced_table

2007-12-22 Thread Richard Broersma Jr
--- 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. Sorry Tom, I guess I am still a bit co

Re: [GENERAL] Constraint Trigger's referenced_table

2007-12-22 Thread Tom Lane
Richard Broersma Jr <[EMAIL PROTECTED]> writes: > So is the purpose of knowing the reference_table OID, is that it helps to > generalize the logic of the CONSTRAINT TRIGGERS? No, the purpose is to support foreign-key triggers. FK constraints are implemented via cooperating triggers on the two ta

Re: [GENERAL] Constraint Trigger's referenced_table

2007-12-22 Thread Richard Broersma Jr
--- On Sat, 12/22/07, Tom Lane <[EMAIL PROTECTED]> wrote: > It doesn't. That table OID is just stored for the > trigger function > to use if it wants to. I see. I was thinking that the FROM clause of the Constraint Trigger would allow tuple modifications from either the ON table or FROM table

Re: [GENERAL] Constraint Trigger's referenced_table

2007-12-22 Thread Tom Lane
Richard Broersma Jr <[EMAIL PROTECTED]> writes: > How does a Constraint Trigger react to a referenced table when the constraint > is created implementing the FROM clause? It doesn't. That table OID is just stored for the trigger function to use if it wants to. regards, t

[GENERAL] Constraint Trigger's referenced_table

2007-12-21 Thread Richard Broersma Jr
How does a Constraint Trigger react to a referenced table when the constraint is created implementing the FROM clause? Regards, Richard Broersma Jr. ---(end of broadcast)--- TIP 6: explain analyze is your friend