X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id E48289DCABB for ; Wed, 4 Jan 2006 21:49:47 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 50611-02 for ; Wed, 4 Jan 2006 21:49:51 -0400 (AST) Received: from hub.org (hub.org [200.46.204.220]) by postgresql.org (Postfix) with ESMTP id 9AF279DCA8C for ; Wed, 4 Jan 2006 21:49:45 -0400 (AST) Received: from localhost (unknown [200.46.204.144]) by hub.org (Postfix) with ESMTP id C820862C8DE for ; Wed, 4 Jan 2006 21:49:50 -0400 (AST) Received: from hub.org ([200.46.204.220]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 47977-07 for ; Wed, 4 Jan 2006 21:49:48 -0400 (AST) Received: from ganymede.hub.org (blk-222-82-85.eastlink.ca [24.222.82.85]) by hub.org (Postfix) with ESMTP id 694E662C8D8 for ; Wed, 4 Jan 2006 21:49:48 -0400 (AST) Received: by ganymede.hub.org (Postfix, from userid 1000) id 5E3C045ECF; Wed, 4 Jan 2006 21:49:52 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id 581E43B94B for ; Wed, 4 Jan 2006 21:49:52 -0400 (AST) Date: Wed, 4 Jan 2006 21:49:52 -0400 (AST) From: "Marc G. Fournier" X-X-Sender: scrappy@ganymede.hub.org To: pgsql-sql@postgresql.org Subject: FOREIGN KEYs ... I think ... Message-ID: <20060104213210.A1088@ganymede.hub.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at hub.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.945 required=5 tests=[AWL=0.466, DNS_FROM_RFC_ABUSE=0.479] X-Spam-Score: 0.945 X-Spam-Level: X-Archive-Number: 200601/18 X-Sequence-Number: 23807 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