"Marc G. Fournier" <scrappy(at)postgresql(dot)org> writes:
> 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 ...
Why not just get rid of the status column in incident_comments, and
treat incident_summary.status as the sole copy of the state? When you
need to get to it from incident_comments, you do a join.
The foreign key you really ought to have here is from
incident_comments.incident_id to incident_summary.id
(assuming that I've understood your schema correctly).
regards, tom lane
In response to
pgsql-sql by date
|Next:||From: Marc G. Fournier||Date: 2006-01-05 03:12:27|
|Subject: Re: FOREIGN KEYs ... I think ... |
|Previous:||From: Marc G. Fournier||Date: 2006-01-05 01:49:52|
|Subject: FOREIGN KEYs ... I think ...|