Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 89BC147644C; Mon, 10 Jun 2002 15:24:32 -0400 (EDT) Received: from ashtonwoodshomes.com (unknown [216.94.125.242]) by postgresql.org (Postfix) with ESMTP id 4C93B476327; Mon, 10 Jun 2002 14:53:42 -0400 (EDT) Received: from greatgulfhomes.com. (IDENT:root@[216.191.203.109]) by ashtonwoodshomes.com (8.11.6/8.11.6) with ESMTP id g5AIpIt08636; Mon, 10 Jun 2002 14:51:18 -0400 Received: from terrynew2 (firewall.development.greatgulfhomes.com [216.191.203.106]) by greatgulfhomes.com. (8.11.6/8.11.6) with SMTP id g5AIp1o11463; Mon, 10 Jun 2002 14:51:01 -0400 From: terry@greatgulfhomes.com To: "'Jan Wieck'" , "'Achilleus Mantzios'" Cc: , Subject: Re: [SQL] VIEWs and FOREIGN keys Date: Mon, 10 Jun 2002 14:49:33 -0400 Message-ID: <002801c210af$9088c980$2766f30a@development.greatgulfhomes.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 In-Reply-To: <200206101720.g5AHKAK29836@saturn.janwieck.net> X-Archive-Number: 200206/289 X-Sequence-Number: 25441 I would just like to elaborate, and clarify if my understanding is correct: The implication of below is that you need a trigger in the foreign key target table on the DELETE event, so the foreign key table only lets you delete a row if there are no other tables refering to the key you want to delete. Views cannot have triggers, hence cannot have a DELETE trigger, therefore that is why the view cannot be a foreign key target table. Terry Fielder Network Engineer Great Gulf Homes / Ashton Woods Homes terry@greatgulfhomes.com > -----Original Message----- > From: pgsql-general-owner@postgresql.org > [mailto:pgsql-general-owner@postgresql.org]On Behalf Of Jan Wieck > Sent: Monday, June 10, 2002 1:20 PM > To: Achilleus Mantzios > Cc: pgsql-general@postgresql.org; pgsql-sql@postgresql.org > Subject: Re: [GENERAL] [SQL] VIEWs and FOREIGN keys > > > Achilleus Mantzios wrote: > > > > can someone have a foreign key constraint that references > > a view?? > > No, and this is not planned either. Remember that it is not > only required for referential integrity to check if a key > exists on INSERT or UPDATE to the referencing table. The > system must guarantee that you cannot remove existing keys > while they are referenced (or more precise perform the > requested referential action). > > > Jan > > -- > > #============================================================= > =========# > # It's easier to get forgiveness for being wrong than for > being right. # > # Let's break this rule - forgive me. > # > #================================================== > JanWieck@Yahoo.com # > > > > ---------------------------(end of > broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly >