FOREIGN KEYs ... I think ... - Mailing list pgsql-sql

From Marc G. Fournier
Subject FOREIGN KEYs ... I think ...
Date
Msg-id 20060104213210.A1088@ganymede.hub.org
Whole thread Raw
Responses Re: FOREIGN KEYs ... I think ...  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: FOREIGN KEYs ... I think ...  (nospam@hardgeus.com)
Re: FOREIGN KEYs ... I think ...  ("Marc G. Fournier" <scrappy@postgresql.org>)
List pgsql-sql
I'm not sure if I'm looking at (for) the right thing or not, but if I am, 
then I'm not finding any useful examples :(

I have two tables, simplified as:

CREATE TABLE incident_summary (  id serial,  subject text,  status boolean
);

CREATE TABLE incident_comments (  id serial,  incident_id int4,  body text,  comment_date timestamp,  status boolean
);

Now, what I want to do is add a FOREIGN KEY (again, I think) that when 
incident_summary.status is changed (either closed, or reopened), the 
associated records in incident_comments are changed to the same state ...

It *looks* like it should be simple enough, I want 
incident_comments.status to change to incident_summary.status whenever 
incident_summary.status changes ... since I'm finding nothing searching on 
FOREIGN KEYS, I'm guessing that I'm looking at the wrong thing ...

So, what should I be searching on / reading for this one?  Pointers 
preferred, especially one with some good examples :)

Thanks ...


----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664


pgsql-sql by date:

Previous
From: "Scott, Casey"
Date:
Subject: JOIN question with multiple records
Next
From: Tom Lane
Date:
Subject: Re: FOREIGN KEYs ... I think ...